Uncaught SyntaxError: Unexpected token u in JSON at position 0
necolas opened this issue · 8 comments
I was looking into using storybook or carte-blanche to create a UI explorer for react-native-web. I followed the README instructions and added this to my webpack config:
new CarteBlanche({
componentRoot: path.join(__dirname, '../src/components'),
filter: /index.js$/
}),
But navigating to any example component produces this error:
Uncaught SyntaxError: Unexpected token u in JSON at position 0
Holy cow that's awesome! Do you have a repro somewhere so I can take a look at this specific bug?
(We don't have support for a non-editable mode at the moment, but if you give me a day I'll get that implemented!)
Oh, having the examples be editable is fine. It would be something used during development as much as for external consumption.
To repro:
- git clone react-native-web
npm install carte-blanche
- Add that code block to
examples/webpack.config.js
npm run examples
Will take a look tomorrow!
Also encountered this one. I made a workaround by fixing
with this:basePath={JSON.parse(pluginData && pluginData.basePath || '{}')}
But the the root cause is probably deeper than that.
@nikgraf I'm getting the same error - Seem to fail while parsing the Component data:
It's calling http://localhost:8082/variations/src/components/Footer/Footer.js, which returns:
{"data":{}}