Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix webpack 5 error "Can't resolve url" for running npm script "dev:mocked" #287

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 26 additions & 11 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@
"pako": "^2.1.0",
"path-browserify": "^1.0.1",
"qr-code-styling": "github:zubiden/qr-code-styling#dbbfed0",
"v8-compile-cache": "^2.4.0"
"v8-compile-cache": "^2.4.0",
"url": "^0.11.3"
},
"optionalDependencies": {
"dmg-license": "^1.0.11",
Expand Down
15 changes: 7 additions & 8 deletions src/components/mediaViewer/helpers/ghostAnimation.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
import { requestMutation } from '../../../lib/fasterdom/fasterdom';

import type { ApiDimensions, ApiMessage } from '../../../api/types';
import { MediaViewerOrigin } from '../../../types';

import { ANIMATION_END_DELAY, MESSAGE_CONTENT_SELECTOR } from '../../../config';
import { requestMutation } from '../../../lib/fasterdom/fasterdom';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DmitriyWebDev no changes in that file except organized imports, it's not part of what this PR is trying to solve, from my POV better to undo the changes and leave only relevant part.

import { getMessageHtmlId } from '../../../global/helpers';
import { applyStyles } from '../../../util/animation';
import { isElementInViewport } from '../../../util/isElementInViewport';
import stopEvent from '../../../util/stopEvent';
import { IS_TOUCH_ENV } from '../../../util/windowEnvironment';
import windowSize from '../../../util/windowSize';
import {
calculateDimensions,
getMediaViewerAvailableDimensions,
MEDIA_VIEWER_MEDIA_QUERY,
REM,
} from '../../common/helpers/mediaDimensions';
import windowSize from '../../../util/windowSize';
import stopEvent from '../../../util/stopEvent';
import { IS_TOUCH_ENV } from '../../../util/windowEnvironment';
import { getMessageHtmlId } from '../../../global/helpers';
import { isElementInViewport } from '../../../util/isElementInViewport';
import { applyStyles } from '../../../util/animation';

const ANIMATION_DURATION = 200;

Expand Down
1 change: 1 addition & 0 deletions webpack.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ export default function createConfig(
path: require.resolve('path-browserify'),
os: require.resolve('os-browserify/browser'),
buffer: require.resolve('buffer/'),
url: require.resolve('url'),
fs: false,
crypto: false,
},
Expand Down