Skip to content
This repository has been archived by the owner on Oct 19, 2020. It is now read-only.

Webpack not compatible with require aliases #126

Closed
tomas-polach opened this issue Feb 15, 2018 · 12 comments
Closed

Webpack not compatible with require aliases #126

tomas-polach opened this issue Feb 15, 2018 · 12 comments

Comments

@tomas-polach
Copy link
Contributor

tomas-polach commented Feb 15, 2018

How to Reproduce

Actual Result

  • webpack complains about require aliases runtime.require (WIP, precise error message follows)

Expected Result

  • app builds without problem

Note

@tomas-polach tomas-polach changed the title Webpack not compatible with dynamic Webpack not compatible with dynamic require calls Feb 15, 2018
@tomas-polach tomas-polach changed the title Webpack not compatible with dynamic require calls Webpack not compatible with require aliases Feb 15, 2018
tomas-polach added a commit that referenced this issue Feb 15, 2018
@bnjm
Copy link
Contributor

bnjm commented Feb 18, 2018

I've been doing some digging into this. It seems webpack spots the require reference and tries to parse it. The same error will occur if you call console.log(require), console.log(typeof require) etc. I could reproduce this with a few of the popular webpack templates (https://github.com/facebook/create-react-app and http://vuejs-templates.github.io/webpack/).

screen shot 2018-02-18 at 23 34 19

Unfortunately this means this means that the current build (1.1.7) is still affected since it includes the getDynamicRequire function which will throw an error to webpack.

I think we can work around this with global.require, but I need to test it... PR incoming

@bnjm
Copy link
Contributor

bnjm commented Feb 20, 2018

Just ran some tests and can confirm that this PR fixes the issue for model-maker #127

@bnjm bnjm reopened this Mar 22, 2018
@bnjm
Copy link
Contributor

bnjm commented Mar 22, 2018

Reopening because this is an issue again in 1.1.8

@kashi-halma
Copy link

I am having this exact same issue with 1.1.8. Any recommendations?

@kashi-halma
Copy link

Please, someone help!

@bnjm
Copy link
Contributor

bnjm commented Apr 20, 2018

Thanks for bumping this, I would suggest using 1.1.5 with webpack until it's resolved.

@kashi-halma
Copy link

kashi-halma commented Apr 21, 2018

bnjm,

Thank you so much for responding. Regardless of what version of the 3dio npm module I use I still get the following error.

screen shot 2018-04-20 at 10 29 53 am
screen shot 2018-04-20 at 10 30 07 am

@bnjm
Copy link
Contributor

bnjm commented Apr 21, 2018

I can't reproduce this with 1.1.5 starting with a fresh wepback + react app and using yarn add [email protected] or npm install [email protected].

If you have a package lock file could you check the output just to make sure 1.1.5 is being installed? If the problem is still occurring with 1.1.5 please let me know as that's a separate issue.

We'll aim to ship a fix for this on Monday. Thanks for your patience!

@kashi-halma
Copy link

Thanks again bnjm!

-from the blockvue dev team

@bnjm
Copy link
Contributor

bnjm commented Apr 25, 2018

hey @bleudreams, there is a PR submitted to resolve this issue: #135, we'll make another release soon to include it!

@bnjm
Copy link
Contributor

bnjm commented May 2, 2018

This is fixed in 1.2.0 which is available now.

@bleudreams Let us know if you still have any problems with this!

@bnjm bnjm closed this as completed May 2, 2018
@kashi-halma
Copy link

kashi-halma commented May 2, 2018 via email

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

No branches or pull requests

3 participants