With my given example, it throws the following error on terminal:
export * from './Player';
^^^^^^
SyntaxError: Unexpected token 'export'
at Object.compileFunction (node:vm:352:18)
at wrapSafe (node:internal/modules/cjs/loader:1032:15)
at Module.compile (node:internal/modules/cjs/loader:1067:27)
at Object.Module.extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:168:29)
at ModuleJob.run (node:internal/modules/esm/module_job:197:25)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Promise.all (index 0) {
page: '/'
}
and the following error on the browser:
Server Error
SyntaxError: Unexpected token 'export'
This error happened while generating the page. Any console logs will be displayed in the terminal window.
Call Stack
<unknown>
/Volumes/HD/rocketseat/starter-webapp/new-starter-kit/spine-test/spine/node_modules/ (esotericsoftware/spine-player/dist/index.js (1)
Object.compileFunction
node:vm (352:18)
wrapSafe
node:internal/modules/cjs/loader (1032:15)
Module._compile
node:internal/modules/cjs/loader (1067:27)
[.....]
But if I change this line of code (export * from './Player'😉 to this (just as example to understand):
const spine = require('./Player')
module.exports = { SpinePlayer: spine.SpinePlayer }
Then this error pass to the next:
export * from "@esotericsoftware/spine-core";
^^^^^^
SyntaxError: Unexpected token 'export'
I've checked the versions: well, my team member is exporting the files from 4.0 and 4.1, and neither works with the latest versions of these packages:
npm install @esotericsoftware/spine-core
npm install @esotericsoftware/spine-canvas
npm install @esotericsoftware/spine-webgl
npm install @esotericsoftware/spine-player
npm install @esotericsoftware/spine-threejs
I'm not sure if the package versions is the same as the versions in github, that's it? Anyway, right now I'm going to downside the packages and test it.