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

Webpack Error while loading assets #1

Closed
chocopoule opened this issue Feb 16, 2017 · 6 comments
Closed

Webpack Error while loading assets #1

chocopoule opened this issue Feb 16, 2017 · 6 comments

Comments

@chocopoule
Copy link

Hi,

I made a fresh clone of your repo to give it a try. However I have the following error while running npm run server:dev

ERROR in ./assets/atlases/preload_sprites_array.png Module parse failed: e:\MyFolder\assets\atlases\preload_sprites_array.png Unexpected character '�' (1:0) You may need an appropriate loader to handle this file type. (Source code omitted for this binary file) @ ./src/assets.ts 30:65-116 @ ./src/states/boot.ts @ ./src/app.ts @ multi (webpack)-dev-server/client?http://localhost:9000 ./src/app.ts

My node version is v6.9.5 and I'm using windows 7

Any idea ?

@rroylance
Copy link
Owner

Hi, sorry you're having an issue.

I'm going to assume it's due to some incompatibility between at least one of the modules/plugins and node 6.9.5, I developed with 7.5.0 and after downgrading to 6.9.5 I see the same issue...

I'll can take a look tonight and see what I can do.

@chocopoule
Copy link
Author

Thanks,

I have been browsing the web for similar issues but I didn't find anything ...
My guess was something around file-loader ...

@ProfitWarning
Copy link

This will load assets
{ test: /\.(jpg|png|xml|mp3|ogg|m4a|fnt|ac3)$/, loader: 'file-loader?name=assets/[hash].[ext]' },

but example breaks with:
ncaught TypeError: url.match is not a function at Phaser.Loader.transformUrl (game.js:72307) at Phaser.Loader.fileComplete (game.js:72934) at HTMLImageElement.file.data.onload (game.js:72452)

@ProfitWarning
Copy link

ProfitWarning commented Feb 18, 2017

It's a Windows thing.
change the file-loader test from /assets\//
to /assets\\/ if you're on a windows box.

Now it works.

@rroylance
Copy link
Owner

rroylance commented Feb 18, 2017

Awesome. Thanks @ProfitWarning and @lejeremy. I haven't had a chance to look at it the last couple days like I thought. I guess Node 7 normalizes path slashes while Node 6 doesn't? I'll get that change in, either way.

@chocopoule
Copy link
Author

Now working like a charm. Thank you guys !

rroylance pushed a commit that referenced this issue Apr 6, 2017
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

3 participants