-
Notifications
You must be signed in to change notification settings - Fork 491
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
Error importing phaser using typescript in Ionic2 #43
Comments
I am receiving the same error as you. Were you able to get this working or no? |
No, I gave up of trying to use Ionic and Phaser using Typescript. Sorry :-/ |
I fixed the phaser-ce module name for typescript a while back now, so it should not fail any longer with version 2.7.5. If it still fails, please provide a sample application, so that the issue can be fixed |
I've updated phaser-ce to 2.7.5 and although the error is different, the application still doesn't work. Importing like this
Results in
Importing like this
results in
I've created a repository in case you want to check it out: https://github.com/esteban-filardi/phaser-test I guess you should install ionic globally,
Then you can run:
to test the application. |
Normally, when using webpack only, the following import should be okay, when correctly configured: Ionic2 and webpack is importing the wrong file. You've to extend the webpack configuration:
Then you can easily import phaser ce by using following import statements:
For build process you then have to specify the webpack config file, because it won't be detected automatically as far as I've seen:
We should consider adding it within the readme, or something else. |
When you don't want to copy the webpack file, you could write a partial and use webpack-merge to merge the app scripts webpack config with the partial one of you. |
Closing for #96 |
//Edit Previously I had problems with my last configuration so I just deleted and start over again. I follow the steps from@Dreaded-Gnu editing the webpack.cofig.js file from node_modules/@ionic/app-scripts/config I had to do some changes to make it works. firstly I change the rootDir variable to I want to use the webpack.config file from my root directory of the project but I got the following error message. my webconfig.js file
Also @Dreaded-Gnu I don't understand what did you mean with webpack-merge, could you explain it please? N.T Sorry for my bad English and I hope this helps someone. |
I did as said by Dreaded-Gnu above.
Please any one help. I am stuck here. |
I was trying to use phaser in a Ionic2 application.
When I try to import phaser I get the following error:
Even vscode warns me there's something wrong with the import statement.
Here's the code:
Can anyone help me resolve this issue?
The text was updated successfully, but these errors were encountered: