faceyspacey / webpack-flush-chunks

💩 server-to-client chunk discovery + transportation for Universal Rendering
MIT License
355 stars 33 forks source link

Chunks not being created with TypeScript : [FLUSH CHUNKS]: Unable to find default in Webpack chunks. Please check usage of Babel plugin #60

Open aneogiarcadix opened 6 years ago

aneogiarcadix commented 6 years ago

I get this error in a Typescript project of mine. So I cloned the universal-demo project and changed things to typescript( except server/index.js ). The project builds successfully, and then I get the same error. image What am I missing here? The only changes I have made to the webpack configs is adding at-loader to the rules and including ts and tsx to resolve extensions.

Current project structure: image tsconfig.json { "compileOnSave": true, "exclude": ["node_modules"], "compilerOptions": { "noStrictGenericChecks": true, "allowJs": true, "declaration": false, "noResolve": false, "jsx": "react", "module": "commonjs", "target": "es2015", "experimentalDecorators": true, "sourceMap": true, "noImplicitAny": false, "noImplicitReturns": true, "outDir": "./dist/", "skipLibCheck": true, "allowSyntheticDefaultImports": true, "moduleResolution": "node", //"types": [ "node" ], "typeRoots": [] } }

sample : https://github.com/aneogiarcadix/universal-demo-ts

ScriptedAlchemy commented 6 years ago

did it work before?

Why not upgrade to latest and use WP 4? every thing is much easier

tstirrat15 commented 6 years ago

@ScriptedAlchemy I'm actually seeing this problem on webpack 4 right now. My impression is that it has something to do with externalization: I encountered this problem when I went to fix my externals webpack configuration. When everything was included in the same server bundle, it worked fine; when I fixed the externalization, things broke.

tstirrat15 commented 6 years ago

The weird thing to me is that it's default. Is that referring to the webpack entrypoint, which would be the default for a module?

tstirrat15 commented 6 years ago

Hmm... It also only shows up when I use webpack-node-externals, which seems strange to me. Why would that make a difference?

It's working fine when I use the example code for webpack externals configuration.