Closed ianpullinger closed 4 years ago
Hi,
I have performed some more problem solving, and I 'think' I have isolated the issue. After removing most of the elements of the site bit-by-bit, I was left with a very simple page. However, if I remove the following line from the index.js file, the development bundle compiles correctly. If I then add it back in, the error message is then displayed.
import { tw, styled } from "twin.macro"
I have managed to get the following error message to be displayed in the browser. I do not have babel or babel-loader explicitly loaded in package.json, so assume it is installed as a dependency. My babel-loader is v8.1.0.
./src/pages/index.js Module build failed (from ./node_modules/gatsby/dist/utils/babel-loader.js): MacroError: /Users/ianpullinger/Desktop/test/src/pages/index.js: at assert (/Users/ianpullinger/Desktop/test/node_modules/twin.macro/macro.js:21:9) at validateImports (/Users/ianpullinger/Desktop/test/node_modules/twin.macro/macro.js:2135:3) at twinMacro (/Users/ianpullinger/Desktop/test/node_modules/twin.macro/macro.js:3479:3) at macroWrapper (/Users/ianpullinger/Desktop/test/node_modules/babel-plugin-macros/dist/index.js:63:12) at applyMacros (/Users/ianpullinger/Desktop/test/node_modules/babel-plugin-macros/dist/index.js:230:14) at ImportDeclaration (/Users/ianpullinger/Desktop/test/node_modules/babel-plugin-macros/dist/index.js:114:28) at NodePath._call (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/path/context.js:55:20) at NodePath.call (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/path/context.js:42:17) at NodePath.visit (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/path/context.js:90:31) at TraversalContext.visitQueue (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/context.js:112:16) at TraversalContext.visitMultiple (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/context.js:79:17) at TraversalContext.visit (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/context.js:138:19) at Function.traverse.node (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/index.js:82:17) at traverse (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/index.js:64:12) at NodePath.traverse (/Users/ianpullinger/Desktop/test/node_modules/@babel/traverse/lib/path/index.js:148:24) at PluginPass.Program (/Users/ianpullinger/Desktop/test/node_modules/babel-plugin-macros/dist/index.js:95:18)
I have managed to solve this issue. I have replaced the following line in all js files:
import { tw, styled } from "twin.macro"
with an updated import statement.
import tw, { styled } from 'twin.macro'
Now the site compiles correctly. It is strange that the errors started to be generated without any site changes, so I am assuming that there must have been a recent change in the plugin that caused it to suddenly fail. I will close the ticket.
Description
My Gatsby project has suddenly started failing with the "ERROR #98123 WEBPACK Generating development JavaScript bundle failed" error being generated for all pages and components as part of building the development bundle. The error has also appeared on Netlify where the site is deployed.
Error Log
... verbose Transition to "runningQueries" > "writingRequires" success write out requires - 0.040s verbose Transition to "runningQueries" > "calculatingDirtyQueries" verbose Transition to "runningQueries" > "runningStaticQueries" verbose Transition to "runningQueries" > "runningPageQueries" success run page queries - 0.019s - 1/1 52.43/s verbose Transition to "runningQueries" > "waitingForJobs" verbose Transition to "runningQueries" > "done" verbose Transition to "startingDevServers"
ERROR #98123 WEBPACK
Generating development JavaScript bundle failed