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

Use .js extension #168

Open
tipy01 opened this issue Jul 7, 2023 · 0 comments
Open

Use .js extension #168

tipy01 opened this issue Jul 7, 2023 · 0 comments

Comments

@tipy01
Copy link

tipy01 commented Jul 7, 2023

I had got these errors on building my app importing svelte-calendar:


ERROR in ./node_modules/svelte-calendar/directives/scrollable.js 1:0-46
Module not found: Error: Can't resolve '../config/scroll' in '/myproject/node_modules/svelte-calendar/directives'
Did you mean 'scroll.js'?
BREAKING CHANGE: The request '../config/scroll' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/svelte-calendar/index.js 11:0-49
Module not found: Error: Can't resolve './directives/scrollable' in '/myproject/node_modules/svelte-calendar'
Did you mean 'scrollable.js'?
BREAKING CHANGE: The request './directives/scrollable' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

ERROR in ./node_modules/svelte-calendar/index.js 13:0-41
Module not found: Error: Can't resolve './config/theme' in '/myproject/node_modules/svelte-calendar'
Did you mean 'theme.js'?
BREAKING CHANGE: The request './config/theme' failed to resolve only because it was resolved as fully specified
(probably because the origin is strict EcmaScript Module, e. g. a module with javascript mimetype, a '*.mjs' file, or a '*.js' file where the package.json contains '"type": "module"').
The extension in the request is mandatory for it to be fully specified.
Add the extension to the request.

I can manage to get rid of that specifying the following in my module rules in webpack.config.js :

                {
                    test: function test(modulePath) {
                        return modulePath.includes('svelte-calendar');
                    },
                    resolve: {
                        fullySpecified: false,
                    },
                }

But it will be smarter if these 3 imported modules have .js extension, like it is expected when package.json includes "type":"module" .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant