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

Tailwind Plugins can't respolve ES modules #258

Closed
Lexpeartha opened this issue Oct 12, 2021 · 4 comments
Closed

Tailwind Plugins can't respolve ES modules #258

Lexpeartha opened this issue Oct 12, 2021 · 4 comments
Labels
bridge bug Something isn't working

Comments

@Lexpeartha
Copy link

Lexpeartha commented Oct 12, 2021

Environment

  • Operating System: Linux
  • Node Version: v14.17.6
  • Nuxt Version: 2.16.0-27226092.034b9901
  • Package Manager: Yarn
  • Bundler: Webpack
  • User Config: head, css, plugins, components, buildModules, modules, build
  • Runtime Modules: -
  • Build Modules: @nuxtjs/tailwindcss@4.2.1, @nuxt/bridge@3.0.0-27234503.d5127e9

Describe the bug and expected behavior

  • Expected behaviour: Development server should start properly upon executing a command

  • What actually happens is that following error gets thrown, and app gets stuck in loading state on localhost:

WARN  [worker] Directory import '.../Projects/nuxt-bridge-with-tailwind-plugins/node_modules/tailwind-config-viewer/server' is not supported resolving ES modules imported from .../Projects/nuxt-bridge-with-tailwind-plugins/.nuxt/nitro/index.mjs
Did you mean to import tailwind-config-viewer/server/index.js?

  Did you mean to import tailwind-config-viewer/server/index.js?
  at finalizeResolution (internal/modules/esm/resolve.js:281:17)
  at moduleResolve (internal/modules/esm/resolve.js:708:10)
  at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:819:11)
  at Loader.resolve (internal/modules/esm/loader.js:89:40)
  at Loader.getModuleJob (internal/modules/esm/loader.js:242:28)
  at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:73:40)
  at link (internal/modules/esm/module_job.js:72:36)
  • What I suspect of: First I thought it was config's module.exports, but it seems that this gets thrown internally from tailwind plugin. Even after changing require syntax to import, error is the same

Steps to reproduce

  1. Go to repo I made for this
  2. Clone repo
  3. Run yarn install
  4. Run yarn dev and this error should pop up

Additional context

  • Screenshot of the console output:
    image
@Lexpeartha Lexpeartha added bridge bug Something isn't working labels Oct 12, 2021
@huynl-96
Copy link
Contributor

Currently you can bypass this by turning off the tailwind-config-viewer plugin
https://tailwindcss.nuxtjs.org/options#viewer

@pi0
Copy link
Member

pi0 commented Oct 13, 2021

Hi. Please follow this discussion for modules support. Tailwind module is not supported at the moment.

@pi0 pi0 closed this as completed Oct 13, 2021
@Lexpeartha
Copy link
Author

@pi0 Why does it say in that discussion that tailwind module is supported for nuxt bridge then?
Also after setting viewer to false, when I navigate to another route, there's a FOUC for a second

@tobiasdiez
Copy link
Contributor

I've the same issue with reproduction at https://codesandbox.io/s/sleepy-torvalds-5m7xw.
@pi0 Tailwind is listed with a green tick (for nuxt-bridge) in https://github.com/nuxt/framework/discussions/751. This should be corrected then I guess.

cc @Atinux as the maintainer of the tailwind module.

@danielroe danielroe transferred this issue from nuxt/framework Apr 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bridge bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants