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

Cannot read property 'has' of null || TypeError: Cannot read property 'has' of null #10

Closed
niieani opened this issue Jul 8, 2017 · 6 comments

Comments

@niieani
Copy link

niieani commented Jul 8, 2017

Hi @indutny.
I've updated again, however the build still crashes. Sorry ;)

[Step 5/6] [Compilation] : Cannot read property 'has' of null || TypeError: Cannot read property 'has' of null
    at Module.isUsed (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/common-shake/lib/shake/module.js:78:19)
    at analyzer.run.getDeclarations.filter (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack-common-shake/lib/shake/replacement.js:100:26)
    at Array.filter (native)
    at ReplacementModule.source (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack-common-shake/lib/shake/replacement.js:99:25)
    at ModuleTemplate.render (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/ModuleTemplate.js:14:31)
    at /home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Template.js:110:28
    at Function.from (native)
    at ChunkTemplate.renderChunkModules (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Template.js:107:26)
    at ChunkTemplate.render (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/ChunkTemplate.js:16:30)
    at Compilation.createChunkAssets (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compilation.js:1255:35)
    at sealPart2 (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compilation.js:628:10)
    at next (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.compilation.plugin (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/ProgressPlugin.js:111:6)
    at Compilation.applyPluginsAsyncSeries (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/tapable/lib/Tapable.js:142:13)
    at Compilation.seal (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compilation.js:578:8)
    at /home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compiler.js:510:16
    at /home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/tapable/lib/Tapable.js:225:11
    at _combinedTickCallback (internal/process/next_tick.js:134:7)
    at process._tickCallback (internal/process/next_tick.js:201:9)

ChunkRenderError: 
    at Compilation.createChunkAssets (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compilation.js:1274:22)
    at sealPart2 (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compilation.js:628:10)
    at next (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/tapable/lib/Tapable.js:138:11)
    at Compilation.compilation.plugin (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/ProgressPlugin.js:111:6)
    at Compilation.applyPluginsAsyncSeries (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/tapable/lib/Tapable.js:142:13)
    at Compilation.seal (/home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compilation.js:578:8)
    at /home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/webpack/lib/Compiler.js:510:16
    at /home/teamcity/agent-09/3b0ebbb1933d0dce/node_modules/tapable/lib/Tapable.js:225:11
    at _combinedTickCallback (internal/process/next_tick.js:134:7)
    at process._tickCallback (internal/process/next_tick.js:201:9)
@indutny
Copy link
Owner

indutny commented Jul 8, 2017

Hello!

No worries! 😉 Let's see how this can be fixed.

@indutny
Copy link
Owner

indutny commented Jul 8, 2017

I suspect that there is a "double-resolution" happening somewhere, but not yet sure why... Just published common-shake@1.5.1 with extra debug logging.

Would you care to update it (with npm --depth=2 update, please double-check npm ls common-shake) and try to build it with DEBUG="common-shake:*" webpack (or any other command, but with DEBUG environment set to this).

It should print a bunch of lines prefixed with common-shake:analyzer.

Thanks!

@indutny
Copy link
Owner

indutny commented Jul 8, 2017

Just updated webpack-common-shake as well. The latest is 1.2.5.

@niieani
Copy link
Author

niieani commented Jul 10, 2017

This seems to be fixed in the latest version.

@niieani niieani closed this as completed Jul 10, 2017
@indutny
Copy link
Owner

indutny commented Jul 10, 2017

Hooray! Out of curiosity, did it reduce the size in any way?

@niieani
Copy link
Author

niieani commented Jul 11, 2017

@indutny see #13.

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

2 participants