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

this._identifier.split error, can't read property #506

Closed
gartz opened this issue Mar 2, 2020 · 4 comments
Closed

this._identifier.split error, can't read property #506

gartz opened this issue Mar 2, 2020 · 4 comments

Comments

@gartz
Copy link

gartz commented Mar 2, 2020

  • Operating System: MacOS
  • Node Version: v12.13.1
  • NPM Version: 6.12.1
  • webpack Version: 4.41.6
  • mini-css-extract-plugin Version: 0.9.0

Expected Behavior

To not throw errors when this._identifier is not a string (might be null)

Actual Behavior

    const resource = this._identifier.split('!').pop();
                                      ^

TypeError: Cannot read property 'split' of undefined

Code

it's huge, but basically when enabled SSR rendering for the CSS loaders

How Do We Reproduce?

Add loaders:

  • css-loader with option onlyLocals: true
  • url-loader with option emitFile: false
  • file-loader with option emitFile: false
@alexander-akait
Copy link
Member

Please create reproducible test repo

@gartz
Copy link
Author

gartz commented Mar 3, 2020

I'm using the react-create-app, if I enable the onlyLocals from css-loader it gives that error mentioned, when I disable it, seems to work, but I'm not sure yet if the builded file is valid.

@alexander-akait
Copy link
Member

alexander-akait commented Mar 3, 2020

@gartz Maybe you can provide steps to reproduce it using CRA?

Don't forget what onlyLocals: true for build on node side , not for the browser side, so you should not enable it

@alexander-akait
Copy link
Member

Close in favor #205

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