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

Svelte loader Module not found #1255

Open
gponty opened this issue Jan 23, 2024 · 2 comments
Open

Svelte loader Module not found #1255

gponty opened this issue Jan 23, 2024 · 2 comments
Labels
Bug Bug Fix Status: Waiting Feedback Needs feedback from the author

Comments

@gponty
Copy link

gponty commented Jan 23, 2024

Hi,
Webpack 4.5

My webpack.config.js :

.addLoader({
                test: /\.svelte$/,
                loader: 'svelte-loader',
            },
            {
                // required to prevent errors from Svelte on Webpack 5+, omit on Webpack 4
                test: /node_modules\/svelte\/.*\.mjs$/,
                resolve: {
                    fullySpecified: false
                }
            }
        )
;

let config = Encore.getWebpackConfig();

config.resolve.mainFields = ['svelte', 'browser', 'module', 'main'];
config.resolve.extensions = ['.mjs', '.js', '.svelte'];
config.resolve.conditionNames = ['svelte', 'browser', 'import'];

let svelte = config.module.rules.pop();
config.module.rules.unshift(svelte);

module.exports = config;

When i import module (by example : import Select from 'svelte-select' ) i have this error :

Module build failed: Module not found:

"./node_modules/svelte-file-dropzone/dist/utils/index.js" contains a reference to the file "./attr-accept".
This file can not be found, please check it for typos or update it if the file got moved.

"./node_modules/svelte-floating-ui/index.js" contains a reference to the file "./core".
This file can not be found, please check it for typos or update it if the file got moved.

Then this files exists :
image

Any idea ?
Thank you

@carsonbot
Copy link

Thank you for this issue.
There has not been a lot of activity here for a while. Has this been resolved?

@Kocal
Copy link
Member

Kocal commented Feb 16, 2025

Encore does not support Webpack 4 since a moment, do you still have the issue with latest Encore version?

@Kocal Kocal added Status: Waiting Feedback Needs feedback from the author Bug Bug Fix labels Feb 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Bug Fix Status: Waiting Feedback Needs feedback from the author
Projects
None yet
Development

No branches or pull requests

3 participants