-
Notifications
You must be signed in to change notification settings - Fork 21
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
Reference error while building in azure pipeline #120
Comments
Are you using the latest version (1.16.0) ? If so, can you try with one of the previous versions (1.15.x) ? I made a small change to the build process that may have caused this, so if you could let me know what happens with an earlier version, that'd be handy thanks. |
No, I am not using the latest version I am using 1.13.1. It was working till the 9th of this month started to have an issue since the 10th. If this helps. |
That's odd, because You might be able to import the import {JsonEditor} from 'json-edit-react/build/index.cjs' I don't know much about Azure pipelines, but I do suspect that the build process might be pulling in the latest version. Can you explicitly specify a max version in your package.json? |
Yes, maybe you're right about the pulling of latest version I'll try adding a strict version and let you know. Also, if that doesn't work I'll try the direct import. |
Thanks a lot, you're a life saver, restricting it to a strict version worked. |
Good to hear. I've just published a new version (1.16.1) with explicit I'm keen for this to work seamlessly in as many environments as possible, so I'll keep trying to make it as flexible as possible, so please post again if you have trouble with a specific version. |
After updating to 1.16.1 I get |
If i try your workaround |
If you wouldn't mind, would you be able to go back through the versions from 1.16.1 to see where the problem came in? I'd like to pin it down exactly. |
@MattChowski I've removed the |
@MattChowski @JoelGeorge693 Can you try with v1.17.2 and see if it's working for you? If not, would you mind sharing your repo (or an equivalent repo) so I can check out the problem for myself? |
@CarlosNZ Unfortunately I am unable to test this at the moment. We needed a really performant solution for the JSON viewer as our jsons can be huge, so we decided to build our own, optimized for our needs. Nevertheless this library is great and is better than any other json editor i've seen! |
All good, just out of interest how big are we talking?
Thank you 🙏 |
ReferenceError: require is not defined in ES module scope, you can use import instead
This file is being treated as an ES module because it has a '.js' file extension and '/home/vsts/work/1/s/node_modules/json-edit-react/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
at file:///home/vsts/work/1/s/node_modules/json-edit-react/build/index.cjs.js:1:20
at ModuleJob.run (node:internal/modules/esm/module_job:234:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
I am facing this error when I am my azure pipeline is building the application. It would be of great help if someone could guide me to a solution.
The text was updated successfully, but these errors were encountered: