TypeError: Cannot read property 'split' of undefined
See original GitHub issueVersion
@nuxtjs/tailwindcss: v4.0.1
tailwindcss: v2.0.4
nuxt: v2.15.3
Steps to reproduce
Fresh install of all dependencies. Enable jit: true
in nuxt.config.js
and run npm run dev
My full Tailwind-specific config is as follows:
tailwindcss: {
cssPath: '~/assets/css/app.css',
configPath: 'tailwind.config.js',
exposeConfig: false,
config: {},
jit: true,
}
What is Expected?
Should run without error once jit
option is set to true
. If I disable jit
, it builds and runs fine.
What is actually happening?
When running npm run dev
with jit
set to true
I get the following error:
Error in ./assets/css/app.css
Module build failed (from ./node_modules/extract-css-chunks-webpack-plugin/dist/loader.js):
ModuleBuildError: Module build failed (from ./node_modules/postcss-loader/dist/cjs.js):
TypeError: Cannot read property 'split' of undefined
at replaceSelector (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/@tailwindcss/jit/src/lib/expandApplyAtRules.js:83:12)
at /Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/@tailwindcss/jit/src/lib/expandApplyAtRules.js:115:31
at /Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/container.js:115:18
at /Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/container.js:74:18
at Root.each (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/container.js:60:16)
at Root.walk (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/container.js:71:17)
at Root.walkRules (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/container.js:113:19)
at /Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/@tailwindcss/jit/src/lib/expandApplyAtRules.js:114:18
at LazyResult.runOnRoot (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/lazy-result.js:303:16)
at LazyResult.runAsync (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/lazy-result.js:355:26)
at LazyResult.async (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/lazy-result.js:205:30)
at LazyResult.then (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss/lib/lazy-result.js:190:17)
at /Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/webpack/lib/NormalModule.js:316:20
at /Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:367:11
at /Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:233:18
at context.callback (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/webpack/node_modules/loader-runner/lib/LoaderRunner.js:111:13)
at Object.loader (/Users/michaelpumo/Documents/websites/work-less-ordinary/node_modules/postcss-loader/dist/index.js:104:7)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5
Top Results From Across the Web
How to prevent cannot read property split of undefined
This error is a TypeError , and it occurs when calling a method, operand, or argument on the wrong data type, or when...
Read more >How to Prevent cannot read property split of ... - Gopi Gorantala
The "cannot read property 'split' of undefined" error occurs when trying to call split() method on a variable that stores an undefined value....
Read more >Cannot Read Property 'split' of Undefined - freeCodeCamp
it will throw the TypeError: Cannot read property 'split' of undefined error. The split method. When split is called on a string, it...
Read more >Uncaught TypeError: Cannot read property 'split' of undefined
Your question answers itself ;) If og_date contains the date, it's probably a string, so og_date.value is undefined.
Read more >TypeError: Cannot read property 'split' of undefined - SitePoint
TypeError : Cannot read property 'split' of undefined ... Somebody please guide me. Zulfi. Zulf. ... If you want contractCode2 to be a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have the same problem. It can work for me.
Before
After
FYI: https://github.com/tailwindlabs/tailwindcss-jit/issues/76
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.