html-validator
html-validator copied to clipboard
TypeError: rawLines.split is not a function
Version
module: 1.5.1 nuxt: 3.6.2
Nuxt configuration
mode:
- [x] universal
- [ ] spa
Nuxt configuration
htmlValidator: {
usePrettier: true,
options: {
rules: {
'heading-level': ['warn', { allowMultipleH1: true }],
},
elements: [
'html5',
{
a: {
permittedDescendants: ['@flow', 'button'],
},
button: {
permittedContent: ['@flow', 'div'],
},
},
],
},
}
What is expected?
No errors.
What is actually happening?
The following error is currently displayed in the nuxt server console:
[nitro] [unhandledRejection] TypeError: rawLines.split is not a function
at codeFrameColumns (C:\Users\inmor\Documents\personal\dashboard\node_modules\.pnpm\@[email protected]\node_modules\@babel\code-frame\lib\index.js:81:26)
at formatMessage (c:\Users\inmor\Documents\personal\dashboard\node_modules\.pnpm\[email protected]\node_modules\html-validate\dist\es\core.js:12345:21)
at c:\Users\inmor\Documents\personal\dashboard\node_modules\.pnpm\[email protected]\node_modules\html-validate\dist\es\core.js:12383:23
at Array.map (<anonymous>)
at c:\Users\inmor\Documents\personal\dashboard\node_modules\.pnpm\[email protected]\node_modules\html-validate\dist\es\core.js:12382:42
at Array.reduce (<anonymous>)
at codeframe (c:\Users\inmor\Documents\personal\dashboard\node_modules\.pnpm\[email protected]\node_modules\html-validate\dist\es\core.js:12381:10)
at checkHTML (C:\Users\inmor\Documents\personal\dashboard\node_modules\.pnpm\@[email protected]\node_modules\@nuxtjs\html-validator\dist\runtime\validator.mjs:31:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {stack: 'TypeError: rawLines.split is not a function
…ions (node:internal/process/task_queues:95:5)', message: 'rawLines.split is not a function'}
The error seems to come from the html-validate package.
Steps to reproduce
Additional information
Checklist
- [x] I have tested with the latest Nuxt version and the issue still occurs
- [x] I have tested with the latest module version and the issue still occurs
- [x] I have searched the issue tracker and this issue hasn't been reported yet
Steps to reproduce
- Create a nuxt project
- Run nuxt server
- See error in server console
same issue here.
module: 1.5.1 nuxt: 3.6.2
same issue here.
module: 1.5.2 nuxt: 3.6.5
using pnpm
I noticed that removing the option usePrettier the error disappear.
do you have tailwind in your project?
from the docs:
"usePrettier enables prettier printing of your source code to show errors in-context.
Consider not enabling this if you are using TailwindCSS, as prettier will struggle to cope with parsing the size of your HTML in development mode."
Hi there, im facing the same problem and not using TailwindCSS (im using vuetify if it helps)
@thunfisch987 no tailwind
I have this issue too with usePrettier option and without tailwind.
[nitro] [unhandledRejection] TypeError: rawLines.split is not a function
at codeFrameColumns (/home/personal/Localhost/project/node_modules/@babel/code-frame/src/index.ts:157:26)
at formatMessage (/home/personal/Localhost/project/node_modules/src/formatters/codeframe.ts:101:4)
at <anonymous> (/home/personal/Localhost/project/node_modules/src/formatters/codeframe.ts:155:15)
at Array.map (<anonymous>)
at <anonymous> (/home/personal/Localhost/project/node_modules/src/formatters/codeframe.ts:154:37)
at Array.reduce (<anonymous>)
at codeframe (/home/personal/Localhost/project/node_modules/src/formatters/codeframe.ts:153:4)
at checkHTML (/home/personal/Localhost/project/node_modules/@nuxtjs/html-validator/dist/runtime/validator.mjs:31:41)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
I believe this should be resolved in 19e3eaf99960b4f28e0fdb8c1d48af9f503a2586.
I believe this should be resolved in 19e3eaf99960b4f28e0fdb8c1d48af9f503a2586.
when i tested it recently it worked afaicr