Jsoneditor: Import breaking on specs

Created on 3 Sep 2019  路  6Comments  路  Source: josdejong/jsoneditor

https://github.com/josdejong/jsoneditor/blob/6e5309665b7fb0eef2ece457613c0112e0d8d70a/src/js/treemode.js#L3

import VanillaPicker from './vanilla-picker';
       ^^^^^^^^^^^^^

SyntaxError: Unexpected identifier

  at ScriptTransformer._transformAndBuildScript (node_modules/@jest/transform/build/ScriptTransformer.js:471:17)
  at ScriptTransformer.transform (node_modules/@jest/transform/build/ScriptTransformer.js:513:25)
  at Object.<anonymous> (node_modules/jsoneditor/src/js/JSONEditor.js:11:5)
bug

All 6 comments

How do you import jsoneditor in your code?

I'm using it on angular 8:

package.json:

"ang-jsoneditor": "^1.8.2",
 "jsoneditor": "^7.0.2",

Then on my code:

import { JsonEditorOptions } from 'ang-jsoneditor';

This only happens when i run specs with "npm run test"

In the error I see:

at Object.<anonymous> (node_modules/jsoneditor/src/js/JSONEditor.js:11:5)

I think there is an issue since 7.0.0 that the index.js of the library is pointing to the wrong file, src/js/JSONEditor.js, should be dist/jsoneditor.js. Will fix this asap, thanks for reporting!

thanks @josdejong

@guiferrpereira can you try v7.0.3, see if this solves your issue? Thanks!

@josdejong it solved the issue. thanks a lot

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bnewcomer picture bnewcomer  路  6Comments

PeterBurner picture PeterBurner  路  3Comments

shinyamade picture shinyamade  路  5Comments

cope picture cope  路  8Comments

realtebo picture realtebo  路  3Comments