vagran / dxf-viewer

DXF 2D viewer written in JavaScript
Mozilla Public License 2.0
290 stars 86 forks source link

ParseError: 'import' and 'export' may appear only with 'sourceType: module' #87

Closed Aupire closed 5 months ago

Aupire commented 9 months ago

I want to use dxf-viewer but I get this error when I use browserify.

browserify ./src/app.js -o ./public/bundle.js :

/node_modules/dxf-viewer/src/index.js:1
export {DxfFetcher} from "./DxfFetcher"
^
ParseError: 'import' and 'export' may appear only with 'sourceType: module'
ezelbanaan commented 5 months ago

I get the same issue when using this in combination with Next.JS. It would be fixed by adding "type":"module" to the package.json as requested in #90

vagran commented 5 months ago

Merged. Sorry for late response, had to allocate time to verify it works with the example project.