Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeError: input.includes is not a function #505

Closed
phillipstemann opened this issue Jul 14, 2022 · 5 comments
Closed

TypeError: input.includes is not a function #505

phillipstemann opened this issue Jul 14, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@phillipstemann
Copy link

phillipstemann commented Jul 14, 2022

Version

@nuxtjs/tailwindcss: 5.3.0
nuxt: 2.15.8

My Tailwind config

/** @type {import('tailwindcss').Config} */ module.exports = { content: [ "./components/**/*.{js,vue}", "./layouts/**/*.vue", "./pages/**/*.vue", "./plugins/**/*.js", "./nuxt.config.js", ], theme: { extend: {}, }, plugins: [ require('@tailwindcss/forms') ], }

Steps to reproduce

I've been using version 5.1.3 without any issues, but the moment I upgraded to 5.2.0 and now also 5.3.0 then, I get the error: TypeError: input.includes is not a function

Version 5.1.3 still works perfectly.

Here are the full error logs:
$ nuxt
ℹ Using default Tailwind CSS file from runtime/tailwind.css nuxt:tailwindcss

FATAL input.includes is not a function

at normalizeWindowsPath (node_modules/pathe/dist/index.mjs:2:14)
at normalize (node_modules/pathe/dist/index.mjs:17:10)
at resolvePath (node_modules/@nuxt/kit/dist/index.mjs:340:10)
at node_modules/@nuxtjs/tailwindcss/dist/module.mjs:166:75
at Array.map ()
at setup (node_modules/@nuxtjs/tailwindcss/dist/module.mjs:166:64)
at async ModuleContainer.normalizedModule (node_modules/@nuxt/kit/dist/index.mjs:607:5)
at async ModuleContainer.addModule (node_modules/@nuxt/core/dist/core.js:239:20)
at async ModuleContainer.ready (node_modules/@nuxt/core/dist/core.js:51:7)
at async Nuxt._init (node_modules/@nuxt/core/dist/core.js:478:5)

╭─────────────────────────────────────────────────╮
│ │
│ ✖ Nuxt Fatal Error │
│ │
│ TypeError: input.includes is not a function │
│ │
╰─────────────────────────────────────────────────╯

error Command failed with exit code 1.

@phillipstemann phillipstemann added the bug Something isn't working label Jul 14, 2022
@pencilcheck
Copy link

very likely caused by this commit:

v5.2.0...v5.3.0

Where they upgraded nuxtjs/kit and it might broke the thing

@phillipstemann
Copy link
Author

Yes, you're right.

@pencilcheck
Copy link

but for me it is weird since I tried to downgrade but still doesn't work from module point of view using this.addModule

@pencilcheck
Copy link

pencilcheck commented Oct 7, 2022

@phillipstemann btw you should also print out the line

    if (typeof cssPath === "string") {
      if (existsSync(cssPath)) {
        logger.info(`Using Tailwind CSS from ~/${relative(nuxt.options.srcDir, cssPath)}`);
        resolvedCss = cssPath;
      } else {
        logger.info("Using default Tailwind CSS file from runtime/tailwind.css");
        resolvedCss = createResolver(import.meta.url).resolve("runtime/tailwind.css");
      }
    }
    nuxt.options.css = nuxt.options.css ?? [];
    console.log('nuxt.options.css', nuxt.options.css)
    const resolvedNuxtCss = await Promise.all(nuxt.options.css.map((p) => resolvePath(p)));

and see for yourself what is wrong, for me somehow nuxt-highlightjs injected an object instead of a string in the css array, and an object is not normalizable for the path and that's why it errored out.

@mena234
Copy link
Contributor

mena234 commented Nov 3, 2022

@pencilcheck @phillipstemann
This should be fixed in the new version 6.1.3.
Issue, pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants