You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been experiencing an issue here with trying to compile a script with specifically @pkmn/sim installed. (Doesn't seem to happen with other @pkmn libraries from what I can see.)
My setup is using Vue+Typescript / webpack.
Here's the specific error I'm getting:
in ./node_modules/@pkmn/sim/build/sim/dex.js
Module parse failed: Unexpected token (102:20)
You may need an additional loader to handle the result of these loaders.
| return dexes['base'];
| const modid = exports.toID(mod);
> if (modData?.Types && !modData.TypeChart)
| modData.TypeChart = modData.Types;
| if (modData?.Species && !modData.Pokedex)
It also returns the same error (Unexpected token) in multiple other files (battle-stream.js(163:40), teams.js(31:42), streams.js(340:17), etc.)
In the code itself, I simply have import dex from '@pkmn/sim' at the top of my file. No other code there yet (Besides default vue items), so it's failing on the import for some reason. I've noticed this happens no matter what class I load from sim as well. If I load BattleStreams, RandomPlayerAI, etc. they will all return the same error at the same location.
This doesn't happen when I use import dex from '@pkmn/dex' ironically, so I think it's something specific with the sim library itself.
Any help on this would be greatly appreciated!
Thanks
The text was updated successfully, but these errors were encountered:
It seems to be complaining about the optional chaining operator? You may need to update your Node version or configure Webpack with a Babel transform to cross compile that away (though I believe Webpack 5 should already do this by default?)
Please reopen with more details if this is still an issue, but I don't think this is an issue with this repository so much as with your project and it's configuration.
@scheibo (Sorry for the delayed response!). Yeah, looks like it. I did some testing and it's definitely something on my end, configuration wise. For some reason my webpack is compiling the optional chaining in my files, but not in loaded modules (Like this one). No idea what's causing it, but definitely not an issue with the library.
Hi there!
I've been experiencing an issue here with trying to compile a script with specifically @pkmn/sim installed. (Doesn't seem to happen with other @pkmn libraries from what I can see.)
My setup is using Vue+Typescript / webpack.
Here's the specific error I'm getting:
It also returns the same error (Unexpected token) in multiple other files (battle-stream.js(163:40), teams.js(31:42), streams.js(340:17), etc.)
In the code itself, I simply have
import dex from '@pkmn/sim'
at the top of my file. No other code there yet (Besides default vue items), so it's failing on the import for some reason. I've noticed this happens no matter what class I load from sim as well. If I load BattleStreams, RandomPlayerAI, etc. they will all return the same error at the same location.This doesn't happen when I use
import dex from '@pkmn/dex'
ironically, so I think it's something specific with the sim library itself.Any help on this would be greatly appreciated!
Thanks
The text was updated successfully, but these errors were encountered: