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

Asset Generation issues... #40

Closed
tomph opened this issue Aug 18, 2017 · 6 comments
Closed

Asset Generation issues... #40

tomph opened this issue Aug 18, 2017 · 6 comments

Comments

@tomph
Copy link

tomph commented Aug 18, 2017

I'm experiencing issues when building for dev/dist that are annoyingly happening only 90% of the time. When asset generation is happening, quite often the compiler falls over with 100s of

"ERROR in ./src/states/Instructions.ts
(25,86): error TS2339: Property 'BitmapFonts' does not exist on type 'typeof "C:/Users/XX/XX/XX/XX/src/assets"'.

It feels like the asset generation has not finished before it tries to compile the JS - meaning I get loads of errors of non-existent assets.

I did try and add in the few lines from the latest merges, but it made no difference.

Any help would be great :)

@SC0d3r
Copy link
Contributor

SC0d3r commented Aug 18, 2017

make sure to add two files with the same name but one .fnt ext and another with .png ext in assets/fonts
to create bitmapFonts
and then run $npm run assets then go and check the assets.ts File, and see if namespace BitmapFonts with yourFontName class is created or not if this is not your current problem take a screenshot of errors and post them

@rroylance
Copy link
Owner

#39 has been merged in with some asset generation fixes; please try the latest version out. Thanks!

@Nepoxx
Copy link
Contributor

Nepoxx commented Dec 1, 2017

That did not fix the issue.

The issue stems from: 1337programming/webpack-shell-plugin#37

You can fix it by replacing

new WebpackShellPlugin({
  onBuildStart: ['npm run assets']
}),

with

new WebpackSynchronizableShellPlugin({
  onBuildStart: {
    scripts: ['npm run assets'],
    blocking: true,
    parallel: false
  }
}),

in your webpack config (npm install webpack-synchronizable-shell-plugin --save-dev of course)

Basically in certain conditions, the typescript compiler could start before the npm run assets was done. I'll make a merge request.

@rroylance
Copy link
Owner

@Nepoxx Huh, interesting, I've never encountered that one. Thanks so much for doing the research and providing the PR! Much appreciated 👍

@Nepoxx
Copy link
Contributor

Nepoxx commented Dec 1, 2017

@rroylance I've never encountered the issue myself someone was not able to build our project due to this. Since it's a race condition it needs specific timings to occur, I think. In any case using WebpackSynchronizableShellPlugin should fix the issue :)

@rroylance
Copy link
Owner

Merged in. Thanks again @Nepoxx !

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

4 participants