Skip to content
New issue

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

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

Already on GitHub? # to your account

webpack-inject-plugin.loader.js?id=webpack-inject-module-1!" contains a reference to the file "fos-router" #446

Open
codegain opened this issue Dec 2, 2022 · 0 comments

Comments

@codegain
Copy link

codegain commented Dec 2, 2022

Hi,

I followed the instructions in the README and i get the following error on builing with webpack:

Module build failed: Module not found:
"./node_modules/webpack-inject-plugin/dist/webpack-inject-plugin.loader.js?id=webpack-inject-module-1!" contains a reference to the file "fos-router".
This file can not be found, please check it for typos or update it if the file got moved.

I added the webpack plugin (using webpack 5 with Symfony Encore) and also have a fos-router folder in the node_modules folder in my project. It just seems that the webpack plugin implementation is somewhat buggy here:

        new InjectPlugin(() => {
            return 'import Routing from "fos-router";' +
                'import routes from "' + this.finalTarget + '";' +
                'Routing.setRoutingData(routes);';
        }).apply(compiler);

Exposing routes works as expected, var/cache/fosRoutes.json also does exis and contains the exposed routes.

Any ideas?

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

No branches or pull requests

1 participant