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

KeyError in loader.py upon error. #69

Closed
jleclanche opened this issue Aug 7, 2016 · 5 comments
Closed

KeyError in loader.py upon error. #69

jleclanche opened this issue Aug 7, 2016 · 5 comments

Comments

@jleclanche
Copy link
Contributor

jleclanche commented Aug 7, 2016

get_bundle defines the following:

            error = u"""
            {error} in {file}
            {message}
            """.format(**assets)

However, upon some webpack errors, my assets dict contained the following:

{
'file': '', 
'message': '(1,24): error TS2307: Cannot find module 'react'.', 
'status': 'error'
}

Therefore, django-webpack-loader crashed, shadowing the root cause of the crash. Was quite frustrating.
I can PR a simple fix that stubs error if it's not in there, but it seems like it's very much supposed to be in there.

@owais
Copy link
Collaborator

owais commented Aug 7, 2016

The stats/manifest file is read only for webpack-loader. It is supposed to be written to only by webpack and read by django. Django should never write to it.

@jleclanche
Copy link
Contributor Author

The error is on read.

@owais
Copy link
Collaborator

owais commented Aug 7, 2016

OK. I suspect you are using webpack config wrong. You should use path option to specify the directory webpack should write to and use filename to specify the name of the file. You are getting wrong results because you are using filename where you should be using path. Check webpack documentation: https://webpack.github.io/docs/configuration.html

@owais owais closed this as completed Aug 7, 2016
@owais owais reopened this Aug 7, 2016
@owais
Copy link
Collaborator

owais commented Aug 7, 2016

Please disregard to previous message. I thought I was replying to something else. Sorry.

@owais
Copy link
Collaborator

owais commented Aug 7, 2016

@jleclanche This seems to be an issue when using typescript. This has been reported before: django-webpack/webpack-bundle-tracker#12

I'd be happy to accept a PR against webpack-bundle-tracker to fix the root cause.

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