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

Support Webpack v4 #32

Closed
mtraynham opened this issue Feb 26, 2018 · 4 comments · Fixed by #33
Closed

Support Webpack v4 #32

mtraynham opened this issue Feb 26, 2018 · 4 comments · Fixed by #33

Comments

@mtraynham
Copy link

I'm getting the following error:

ERROR in ./src/utils/404/404.extract.html
Module build failed: TypeError: Cannot read property 'output' of undefined
    at Object.extractLoader (./node_modules/extract-loader/src/extractLoader.js:31:72)
 @ ./src/utils/404/404.component.ts 18:15-44
 @ ./src/app/index.routing.ts
 @ ./src/app/index.module.ts
 @ ./src/main.ts

This points to the line https://github.com/peerigon/extract-loader/blob/master/src/extractLoader.js#L31, which seems this.options.output is no longer defined.

According to the v4 migration guide (here), this.options has been removed. Instead of loader-utils and checking this.options, you now get all options from this.query. Although, I'm not sure if that carries the publicPath option set by the webpack config. Also not sure what that publicPath's intended usage is here within the context of extract-loader. Setting it to null worked for me.

@vhmth
Copy link

vhmth commented Feb 27, 2018

This fails in v3 (3.9.1) as well. Setting to options: { publicPath: null } worked too!

@danielmeneses
Copy link

@mtraynham you are right that solves partially, but I had to set "publicPath" as an empty string otherwise it will concat "null" to all paths if you are using "html-loader" to process paths from lets say "img:src".

@jhnns
Copy link
Member

jhnns commented Mar 18, 2018

Thanks for pointing out 👍. We're about to ship a fix for this, see PR.

@vhmth
Copy link

vhmth commented Apr 16, 2018

🎉

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

Successfully merging a pull request may close this issue.

5 participants