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

Vue cli webpack build fails when add three-musketeers #3

Open
johnEiratech opened this issue Jul 30, 2019 · 9 comments
Open

Vue cli webpack build fails when add three-musketeers #3

johnEiratech opened this issue Jul 30, 2019 · 9 comments

Comments

@johnEiratech
Copy link

Hi,
I love this library so thanks for developing it:)
When I install it, it warns:
warning three-musketeers > [email protected]: Deprecated. Please use https://github.com/webpack-contrib/mini-css-extract-plugin

Then when i try to do a build, it fails with

Module build failed (from ./node_modules/@vue/cli-service/node_modules/mini-css-extract-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/file-loader/dist/cjs.js):
TypeError: Cannot read property 'context' of undefined

If I remove three-musketeers, everything works fine.
Any ideas?

@FarhadG
Copy link
Contributor

FarhadG commented Aug 2, 2019

Thanks for the kind words, @johnEiratech! Glad you're finding it useful. There are so many more features that would be awesome to built into it, but one step at a time :)

If you can publish a POC showing this error, I can take a look and see what's the issue.

Also, not sure why your project is trying to build three-musketeers. It should be pointing to the built version so it shouldn't be throwing any errors, unless node_modules is not being excluded in your Webpack config.

@johnEiratech
Copy link
Author

Hi,
Thanks for getting back to me. Here is a repo with the poc you requested.

When you run yarn serve, you will see the errors after doing yarn install.
You will also have to install vue-cli, see here.
To inspect the webpack config, you can run vue inspect > output.js.

@FarhadG
Copy link
Contributor

FarhadG commented Aug 6, 2019

Thanks for this, @johnEiratech! At first glance, it's very strange that Vue is even trying to compile the node_modules. It shouldn't be doing that...

Another thing is that when I comment out the font imports in your code, nearly all of the errors go away except for one.

Will need to investigate further but need to know more about Vue's bundling process to find out more.

@johnEiratech
Copy link
Author

it only seems to be clashing with css loaders, have you tried updating extract-text-webpack-plugin to mini-css-extract-plugin? I tried adding the minified library into index.html but i got errors. Have you tried that? If I could include it in the index.html file, that would work for me with some extra webpack configuration.
Really want to test with this library as I build a map from websocket events and with your library, i can test the whole end to end flow so fingers crossed:)

@FarhadG
Copy link
Contributor

FarhadG commented Aug 23, 2019

Yeah those loaders have all been removed from the build Webpack config, @johnEiratech! I may just do a basic Webpack config outside of React and build the library that way—it may be easier that way. I used create-react-app to get up and running quickly.

Do you have any boilerplates Webpack examples that could run this library? If so, I can try a quick swap and publish.

@johnEiratech
Copy link
Author

I'll pull the code and try a different webpack config without react to build and see how it goes, I think I have one somewhere. I'll let you know how it goes 👍

@FarhadG
Copy link
Contributor

FarhadG commented Oct 30, 2019

Any luck with your work, @johnEiratech?

@Krupasrinivasan
Copy link

Hi Farhad,
I am working with your library. When i try to import three-musketeers
import musketeers from '../modules/three-musketeers.min.js';
its showing the following error
Uncaught SyntaxError: The requested module '../modules/three-musketeers.min.js' does not provide an export named 'default'
Can you help me out with this?

@cryptosmiler
Copy link

Hello team.
If you are facing issues with the Three-Musketeers approach in combination with Vue CLI and Webpack, and you're looking for an alternative setup, you can consider using Docker and Webpack directly without the Three-Musketeers tool.If you are facing issues with the Three-Musketeers approach in combination with Vue CLI and Webpack, and you're looking for an alternative setup, you can consider using Docker and Webpack directly without the Three-Musketeers tool. I will provide guide on how to set up a Vue.js project using Docker and Webpack if you feel free.

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

4 participants