Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require: warn invalid json #1700

Merged
merged 4 commits into from Nov 19, 2019
Merged

Conversation

linoleum-js
Copy link
Contributor

closes #1580

@goto-bus-stop goto-bus-stop self-requested a review January 4, 2018 10:20
Copy link
Member

@goto-bus-stop goto-bus-stop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for picking this up! & sorry for the long wait. would you mind rebasing this?

index.js Outdated Show resolved Hide resolved
@goto-bus-stop goto-bus-stop added this to the v17 milestone Nov 15, 2018
@goto-bus-stop goto-bus-stop merged commit e52476b into browserify:master Nov 19, 2019
@Nikerabbit
Copy link

This broke our script that transforms a JSON file to JavaScript file because it is checking the transformed output that is no longer JSON:

"$BASEDIR"/node_modules/browserify/bin/cmd.js "$INPUT"/data/data.json -t "$BASEDIR"/scripts/transform.js -o "$DEST"/data.js

SyntaxError: While parsing /[...]/data.json: Unexpected token ( in JSON at position 0
    at JSON.parse (<anonymous>)
    at DestroyableTransform._transform (/home/nike/stuff/mw/jquery.uls/node_modules/browserify/index.js:669:22)
    at DestroyableTransform.Transform._read (/home/nike/stuff/mw/jquery.uls/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at DestroyableTransform.Transform._write (/home/nike/stuff/mw/jquery.uls/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at Labeled.Pipeline._write (/home/nike/stuff/mw/jquery.uls/node_modules/stream-splicer/index.js:70:22)
    at doWrite (/home/nike/stuff/mw/jquery.uls/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/home/nike/stuff/mw/jquery.uls/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Labeled.Writable.write (/home/nike/stuff/mw/jquery.uls/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Labeled.ondata (/home/nike/stuff/mw/jquery.uls/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at Labeled.emit (events.js:198:13)

Is there a better way to do this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Browserify tolerates require() of invalid JSON
4 participants