Open DaneEveritt opened 5 years ago
Also if I try to use babel-plugin-tailwind-components@next
I get:
ERROR in ./resources/scripts/index.tsx
Module build failed (from ./node_modules/babel-loader/lib/index.js):
MacroError: [BABEL] /srv/www/resources/scripts/index.tsx: The macro you imported from "undefined" is being executed outside the context of compilation with babel-plugin-macros. This indicates that you don't have the babel plugin "babel-plugin-macros" configured correctly. Please see the documentation for how to configure babel-plugin-macros properly: https://github.com/kentcdodds/babel-plugin-macros/blob/master/other/docs/user.md (While processing: "/srv/www/node_modules/babel-plugin-tailwind-components/macro.js")
at macroWrapper (/srv/www/node_modules/babel-plugin-macros/dist/index.js:58:13)
at loadDescriptor (/srv/www/node_modules/@babel/core/lib/config/full.js:165:14)
at cachedFunction (/srv/www/node_modules/@babel/core/lib/config/caching.js:33:19)
at loadPluginDescriptor (/srv/www/node_modules/@babel/core/lib/config/full.js:200:28)
at config.plugins.reduce (/srv/www/node_modules/@babel/core/lib/config/full.js:69:20)
at Array.reduce (<anonymous>)
at recurseDescriptors (/srv/www/node_modules/@babel/core/lib/config/full.js:67:38)
at loadFullConfig (/srv/www/node_modules/@babel/core/lib/config/full.js:108:6)
at process.nextTick (/srv/www/node_modules/@babel/core/lib/transform.js:28:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
@ multi (webpack)-dev-server/client?https://0.0.0.0:8080 (webpack)/hot/dev-server.js ./resources/styles/main.css ./resources/scripts/index.tsx main[3]```
I'm getting the same problem any update anyone? I'm using babel-plugin-tailwind-components@next too.
@GTDev87 I solved this one, turns out I couldn't use ts-loader
and Babel together, I just moved it to be entirely babel
for compiling the TS and it started working.
Howdy! Spent the last few hours trying to figure out if I was doing something stupid here, but just hitting walls and Google is letting me down.
I'm trying to use this without the macros by using the
babel-plugin-tailwind-components
, but I'm just gettingReferenceError: tw is not defined
whenever I try to render a component. However things compile without any issues. Its just when I go to load whatever page has the component in the browser. I should mention this is not Tailwind v1.SomeComponent.tsx
webpack.config.js
package.json
I'm kind of out of ideas here for what I might be doing wrong. If you need more information let me know, not sure what would be helpful here.