Skip to content

SyntaxError while building browser bundle #570

Closed
@GabenGar

Description

@GabenGar

It crashes at this stage, so I assume when building a browser bundle:

> [email protected] build:browser
> browserify src/index.ts -s jstt -p tsify > dist/bundle.js

SyntaxError: 'import' and 'export' may appear only with 'sourceType: module' (2:0) while parsing {project_path}\node_modules\@bcherny\json-schema-ref-parser\lib\index.js while parsing file: {project_path}\node_modules\@bcherny\json-schema-ref-parser\lib\index.js
    at DestroyableTransform.end [as _flush] ({project_path}\node_modules\insert-module-globals\index.js:114:21)
    at DestroyableTransform.prefinish ({project_path}\node_modules\readable-stream\lib\_stream_transform.js:138:10)
    at DestroyableTransform.emit (node:events:514:28)
    at prefinish ({project_path}\node_modules\readable-stream\lib\_stream_writable.js:619:14)
    at finishMaybe ({project_path}\node_modules\readable-stream\lib\_stream_writable.js:627:5)
    at endWritable ({project_path}\node_modules\readable-stream\lib\_stream_writable.js:638:3)
    at Writable.end ({project_path}\node_modules\readable-stream\lib\_stream_writable.js:594:22)
    at DestroyableTransform.onend ({project_path}t\node_modules\readable-stream\lib\_stream_readable.js:577:10)
    at Object.onceWrapper (node:events:628:28)
    at DestroyableTransform.emit (node:events:526:35)

Possibly related to building on Windows 10 with Node v20.9.0.

I've looked at the similar browserify issues but all of them seem to be unrelated:

Seeing @bcherny\json-schema-ref-parser in the logs, it's probably the problem with the build output of that fork, I'll check it out later.

Metadata

Metadata

Assignees

No one assigned

    Labels

    externalThis is an issue with a library that we depend on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions