Skip to content

Error: Unexpected token #18

@josephg

Description

@josephg

Might be related to #14, but I'm getting more parsing errors when browserifying using tinyify. Using tinyify@2.5.0

My target is the json1 OT library at SHA 8907bf44049003efa0e3c26146fd891524b91264

The error seems to be related to environment variable handling. If I change this line:

const RELEASE_MODE = process.env.JSON1_RELEASE_MODE

to

const RELEASE_MODE = 0 // or 1 or any other constant

then browserify runs successfully. It crashes if I use process.env.NODE_ENV === 'production'.

I'll have a deeper look when I have some more time if nobody else gets to it by then.

sephsmac:json1 josephg$ browserify -p tinyify lib/json1.js 
Error: Line 1421: Unexpected token ...
    at ErrorHandler.constructError (/Users/josephg/src/ottypes/json1/node_modules/esprima/dist/esprima.js:5012:22)
    at ErrorHandler.createError (/Users/josephg/src/ottypes/json1/node_modules/esprima/dist/esprima.js:5028:27)
    at Parser.unexpectedTokenError (/Users/josephg/src/ottypes/json1/node_modules/esprima/dist/esprima.js:1985:39)
..

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions