jsonMode.js:7 Uncaught ReferenceError: exports is not defined
See original GitHub issueDescribe the bug Console error for only json, html and css languages. For other languages it’s working fine.
jsonMode.js:7 Uncaught ReferenceError: exports is not defined
at jsonMode.js:7
at jsonMode.js:7
at t._createAndEvalScript (loader.js:794)
at loader.js:776
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61)
(anonymous) @ jsonMode.js:7
(anonymous) @ jsonMode.js:7
t._createAndEvalScript @ loader.js:794
(anonymous) @ loader.js:739
readFileAfterClose @ internal/fs/read_file_context.js:61
htmlMode.js:7 Uncaught ReferenceError: exports is not defined
at htmlMode.js:7
at htmlMode.js:7
at t._createAndEvalScript (loader.js:794)
at loader.js:776
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61)
(anonymous) @ htmlMode.js:7
(anonymous) @ htmlMode.js:7
t._createAndEvalScript @ loader.js:794
(anonymous) @ loader.js:739
readFileAfterClose @ internal/fs/read_file_context.js:61
cssMode.js:7 Uncaught ReferenceError: exports is not defined
at cssMode.js:7
at cssMode.js:7
at t._createAndEvalScript (loader.js:794)
at loader.js:776
at FSReqCallback.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:61)
To Reproduce
Steps to reproduce the behavior:
- Go to ‘…’
- Click on ‘…’
- Scroll down to ‘…’
- See error
Or, please add a minimal code snippet to reproduce the issue, for example in codesandbox.
Expected behavior A clear and concise description of what you expected to happen.
Screenshots If applicable, add screenshots to help to explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
Additional context Add any other context about the problem here.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
Uncaught ReferenceError: exports is not defined in filed ...
Basically giving it what it wants, a global exports variable. With that my TypeScript (2.3.2) generated file (es6) loads. Share.
Read more >Uncaught ReferenceError: exports is not defined : r/typescript
Getting this error for some dumb reason i'm sure. Uncaught ReferenceError: exports is not defined. at app.js:2. (anonymous) @ app.js:2. all ...
Read more >How to fix ReferenceError: exports is not defined TypeScript
ReferenceError: exports is not defined. Solution. If you are getting the error for code that runs in the browser, try defining a global...
Read more >worker-javascript.js ... _ - Code Metrics - Kaapiii/concrete5
The variable s seems to not be initialized for all possible execution paths. Are you sure call handles undefined variables? Loading history...
Read more >"Fossies" - the Fresh Open Source Software Archive
defineProperties(r,n),r}}if, exports: factory,. (Object.defineProperty){var g=m({}),y=typeof document=="undefined"||m(document.c, initialized: true.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Unfortunately, this is the only reason stopping me from using this awesome lib. I can’t figure out a fix for this, and the issue happens on production build also in my case.
@suren-atoyan, I’m not using the template OP is using. Is there anything else I have to check? Other languages work just fine. Only
json
causes issues.Hi, @Nick-Lucas, I’ve tried your solution and it kinda works. I get different editors working in my Electron app BUT I also get an error in the dev build. The error is: It occurs in the last line of the webpacked renderer.dev.js which is:
The application seems to work fine after and the problem does not exists in prod.
I’m guessing there should be a webpack way of solving this ?