Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Module is missing in production mode (webpack) #390

Open
AndyOGo opened this issue Sep 4, 2018 · 6 comments
Open

Module is missing in production mode (webpack) #390

AndyOGo opened this issue Sep 4, 2018 · 6 comments

Comments

@AndyOGo
Copy link

AndyOGo commented Sep 4, 2018

Is this a bug report?

(write your answer here)

Yes.

Though is related to fixed webpack version of 3.8.1:

And we use react-app-rewired, with typescripts, which uses your package und your nailed webpack version.

Can you also reproduce the problem with npm 4.x?

I use npm 5...

Which terms did you search for in User Guide?

(Write your answer here if relevant.)

Environment

  1. npm ls react-scripts-ts (if you haven’t ejected):
  2. node -v:
  3. npm -v:
  4. yarn --version (if you use Yarn):
  5. npm ls react-scripts-ts (if you haven’t ejected):

Then, specify:

  1. Operating system:
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

We have a reproduction repo:

  1. git clone https://github.com/martinoss/reproduce-scss-bug
  2. yarn build
  3. open localhost
  4. Will throw:
    TypeError: Cannot read property 'call' of undefined
    o (main.9cac5c4f.js:formatted:26)
    544 (persons-list.scss:1)
    o (main.9cac5c4f.js:formatted:26)
    543 (persons-list.scss?3174:4)
    o (main.9cac5c4f.js:formatted:26)
    542 (1.56e5fc78.chunk.js:1)
    o (main.9cac5c4f.js:formatted:26)
    Promise.then (async)
    loader (routes.ts:6)
    f (main.9cac5c4f.js:formatted:6499)
    v (main.9cac5c4f.js:formatted:6566)
    n (main.9cac5c4f.js:formatted:6591)
    Ii (main.9cac5c4f.js:formatted:11110)
    da (main.9cac5c4f.js:formatted:11833)
    ha (main.9cac5c4f.js:formatted:11854)
    Ga (main.9cac5c4f.js:formatted:12109)
    Ya (main.9cac5c4f.js:formatted:12068)
    Ha (main.9cac5c4f.js:formatted:12056)
    za (main.9cac5c4f.js:formatted:12011)
    ba (main.9cac5c4f.js:formatted:11941)
    enqueueSetState (main.9cac5c4f.js:formatted:10547)
    O.setState (main.9cac5c4f.js:formatted:7392)
    t (main.9cac5c4f.js:formatted:6630)
    (anonymous) (main.9cac5c4f.js:formatted:6638)
    Promise.then (async)
    n._loadModule (main.9cac5c4f.js:formatted:6637)
    n.componentWillMount (main.9cac5c4f.js:formatted:6608)
    li (main.9cac5c4f.js:formatted:10594)
    Ii (main.9cac5c4f.js:formatted:11117)
    da (main.9cac5c4f.js:formatted:11833)
    ha (main.9cac5c4f.js:formatted:11854)
    Ga (main.9cac5c4f.js:formatted:12109)
    Ya (main.9cac5c4f.js:formatted:12068)
    Ha (main.9cac5c4f.js:formatted:12056)
    za (main.9cac5c4f.js:formatted:12011)
    ba (main.9cac5c4f.js:formatted:11941)
    ou (main.9cac5c4f.js:formatted:12498)
    au (main.9cac5c4f.js:formatted:12508)
    hu.render (main.9cac5c4f.js:formatted:12705)
    (anonymous) (main.9cac5c4f.js:formatted:12599)
    eu (main.9cac5c4f.js:formatted:12435)
    vu (main.9cac5c4f.js:formatted:12598)
    render (main.9cac5c4f.js:formatted:12755)
    (anonymous) (main.9cac5c4f.js:formatted:7334)
    o (main.9cac5c4f.js:formatted:26)
    (anonymous) (main.9cac5c4f.js:formatted:6753)
    o (main.9cac5c4f.js:formatted:26)
    (anonymous) (main.9cac5c4f.js:formatted:100)
    (anonymous) (main.9cac5c4f.js:formatted:101)

Expected Behavior

(Write what you thought would happen.)

Webpack's automatic Code-Splitting should work, containing all needed modules.

Actual Behavior

(Write what happened. Please add screenshots!)

Webpacks automatic Code-Splitting does not work, because at least one module is missing.
This is a known webpack bug, and higher versions should provide bugfixes.

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

https://github.com/martinoss/reproduce-scss-bug

@r3nya
Copy link
Contributor

r3nya commented Sep 28, 2018

Hey!

Sorry but your stacktrace will be more helpful if you do it w/o code minification. :)

@AndyOGo
Copy link
Author

AndyOGo commented Oct 1, 2018

@r3nya
You are absolutely right.
Though this error happens only in production mode 😞

I linked known webpack issues regarding missing modules for production builds.

@r3nya
Copy link
Contributor

r3nya commented Oct 1, 2018

@AndyOGo oh man, got it.

I recommend to do ejecting configs, disable code minification manually and try to build again. ;)

@AndyOGo
Copy link
Author

AndyOGo commented Oct 1, 2018

@r3nya
Thanks for your quick reply.

I checked those issues regarding webpack and they should have been fixed in higher version.
So I guess just upgrading webpack. should fix it.

@r3nya
Copy link
Contributor

r3nya commented Oct 1, 2018

Wow, sounds good.

Btw, we will have webpack@4 soon (#409). ;)

@AndyOGo
Copy link
Author

AndyOGo commented Oct 1, 2018

great, then I'm looking forward for this PR :)

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

2 participants