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
gatsby-browser.js: not changed gatsby-ssr.js: not changed
Actual result
If I don't try to use Style everything works fine. If I as much as try to console.log() it, I get this:
ERROR Failed to compile with 1 errors 23:57:21
error in ./src/pages/index.js
Module parse failed: ~/test/node_modules/babel-loader/lib/index.js?{"plugins":["~/test/node_modules/gatsby/dist/utils/babel-plugin-extract-graphql.js","~/test/node_modules/react-hot-loader/babel.js","~/test/node_modules/babel-plugin-transform-react-jsx-source/lib/index.js","~/test/node_modules/babel-plugin-add-module-exports/lib/index.js","~/test/node_modules/babel-plugin-transform-object-assign/lib/index.js"],"presets":[["~/test/node_modules/babel-preset-env/lib/index.js",{"loose":true,"uglify":true,"modules":"commonjs","targets":{"browsers":["> 1%","last 2 versions","IE >= 9"]},"exclude":["transform-regenerator","transform-es2015-typeof-symbol"]}],"~/test/node_modules/babel-preset-stage-0/lib/index.js","~/test/node_modules/babel-preset-react/lib/index.js"],"cacheDirectory":true}!~/test/src/pages/index.js this.state.current.addBlock is not a function
You may need an appropriate loader to handle this file type.
TypeError: this.state.current.addBlock is not a function
at Parser.<anonymous> (~/test/node_modules/webpack/lib/dependencies/AMDRequireDependenciesBlockParserPlugin.js:36:24)
at Parser.applyPluginsBailResult (~/test/node_modules/tapable/lib/Tapable.js:48:50)
at Parser.walkCallExpression (~/test/node_modules/webpack/lib/Parser.js:727:22)
at Parser.walkExpression (~/test/node_modules/webpack/lib/Parser.js:552:40)
at Parser.walkExpressionStatement (~/test/node_modules/webpack/lib/Parser.js:387:7)
at Parser.walkStatement (~/test/node_modules/webpack/lib/Parser.js:378:32)
at Parser.<anonymous> (~/test/node_modules/webpack/lib/Parser.js:371:8)
at Array.forEach (<anonymous>)
at Parser.walkStatements (~/test/node_modules/webpack/lib/Parser.js:370:13)
at Parser.parse (~/test/node_modules/webpack/lib/Parser.js:920:8)
at Object.ModuleParserHelpers.addParsedVariable (~/test/node_modules/webpack/lib/ModuleParserHelpers.js:10:9)
at Parser.<anonymous> (~/test/node_modules/webpack/lib/ProvidePlugin.js:36:28)
at Parser.applyPluginsBailResult (~/test/node_modules/tapable/lib/Tapable.js:48:50)
at Parser.walkIdentifier (~/test/node_modules/webpack/lib/Parser.js:760:21)
at Parser.walkExpression (~/test/node_modules/webpack/lib/Parser.js:552:40)
at Parser.<anonymous> (~/test/node_modules/webpack/lib/Parser.js:546:9)
at Array.forEach (<anonymous>)
at Parser.walkExpressions (~/test/node_modules/webpack/lib/Parser.js:544:14)
at Parser.walkCallExpression (~/test/node_modules/webpack/lib/Parser.js:735:9)
at Parser.walkExpression (~/test/node_modules/webpack/lib/Parser.js:552:40)
at Parser.walkExpressionStatement (~/test/node_modules/webpack/lib/Parser.js:387:7)
at Parser.walkStatement (~/test/node_modules/webpack/lib/Parser.js:378:32)
@ ./.cache/sync-requires.js 12:50-101
Expected behavior
I should be able to use Style to created styled components in any JS module.
Steps to reproduce
Just try accessing the default import in any way, for example:
console.log(Style)
I might add the the default import for React works just fine.
The text was updated successfully, but these errors were encountered:
I'm experiencing this issue as well and it does seem to be some kind of conflict with the styled-components gatsby plugin since I never had this problem using ProvidePlugin with React and styled-components in non gatsby projects.
Ultimately though it's not a huge deal. Perhaps when support for webpack 4 drops this problem will magically go away...
Description
I'm trying to add styled-components as a default import using WebPack's ProvidePlugin but when I try to use the import it fails.
Environment
Gatsby version:
^1.9.158
Node.js version:
v8.9.4
Operating System: Debian Testing (Buster)
File contents (if changed):
gatsby-config.js
:package.json
:gatsby-node.js
:gatsby-browser.js
: not changedgatsby-ssr.js
: not changedActual result
If I don't try to use
Style
everything works fine. If I as much as try toconsole.log()
it, I get this:Expected behavior
I should be able to use
Style
to created styled components in any JS module.Steps to reproduce
Just try accessing the default import in any way, for example:
I might add the the default import for
React
works just fine.The text was updated successfully, but these errors were encountered: