You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 20, 2018. It is now read-only.
ERROR in dir/~/json-loader!dir/embedded/config.json
Module build failed: SyntaxError: Unexpected token m
at Object.parse (native)
at Object.module.exports (dir/node_modules/json-loader/index.js:7:48)
@ dir/embedded/includers/index.js 12:21-51
and in the includers/index.js I have this line:
var embeddedConfig = require("json!../config.json");
After checking, the problem is that the json-loader gets called two times, and the first one returns the expected outcome: "module.exports = {....}" but the second time it has "module.exports = {....}" as a source, so it tries to parse the string to JSON and then it fails because it's not a valid JSON.
Is anyone else getting the same error or did I do something wrong in the configuration?
The text was updated successfully, but these errors were encountered:
xavimb
changed the title
Error when trying to import the same file more than once
Error when trying to require a JSON file
Oct 2, 2015
Webpack version: 0.12.2
I'm getting this error:
and in the
includers/index.js
I have this line:var embeddedConfig = require("json!../config.json");
After checking, the problem is that the json-loader gets called two times, and the first one returns the expected outcome:
"module.exports = {....}"
but the second time it has"module.exports = {....}"
as a source, so it tries to parse the string to JSON and then it fails because it's not a valid JSON.Is anyone else getting the same error or did I do something wrong in the configuration?
The text was updated successfully, but these errors were encountered: