Hi, I have this error, I’m trying to update the version of gojs in my project, to version 3. Can you help me please?
ERROR in ./node_modules/gojs/release/go-module.js 8:354
Module parse failed: Unexpected token (8:354)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See Concepts | webpack
| * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE.
| */…
That library file, go-module.js, is a JavaScript file that is also an ES module.
Is your project using ES modules, or is it still using UMD/AMD/CommonJS/Require when importing libraries, or something else?
The GoJS library (in any module format) has no dependencies at all.
Yes, I think my team is using the commonJS form with libraries, is that a problem? I just did npm install gojs, and then npm run dev, and that problem appear
What is your import statement for the GoJS library? Lots of people and our own limited experience with projects using Angular, React, and Vue (and others) haven’t had a problem importing “gojs” when using a package.json and node_modules.
I don’t know what kind of project you have, so I cannot guess why your project build procedure decided to depend on the ES modules instead of the CommonJS/UMD file which is go.js or go-debug.js.