tailwind-config-viewer witch nuxt-bridge and ES issue
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch @nuxtjs/[email protected] for the project I'm working on.
Description: Import of whole directory is broken. Had to import server/index.js
Here is the diff that solved my problem:
diff --git a/node_modules/@nuxtjs/tailwindcss/dist/runtime/config-viewer.js b/node_modules/@nuxtjs/tailwindcss/dist/runtime/config-viewer.js
index d03355c..61b2192 100644
--- a/node_modules/@nuxtjs/tailwindcss/dist/runtime/config-viewer.js
+++ b/node_modules/@nuxtjs/tailwindcss/dist/runtime/config-viewer.js
@@ -1,5 +1,5 @@
import {withoutTrailingSlash, withTrailingSlash} from "ufo";
-import createServer from "tailwind-config-viewer/server";
+import createServer from "tailwind-config-viewer/server/index.js";
const server = createServer({
tailwindConfigProvider: () => process.nuxt ? process.nuxt.$config.tailwind.getConfig() : {}
}).asMiddleware();
This issue body was partially generated by patch-package.
Facing issue with tailwind-config-viewer [tailwindcss package] when applying nuxt bridge.
Facing issue with tailwind-config-viewer [tailwindcss package] when applying nuxt bridge.
![]()
Having the same issue
I've tried applying the patch by @ansix (thanks a lot!) which solved the initial issue, but now I'm running into an error 500 when trying to open http://localhost:3000/_tailwind:
Cannot read property '$config' of undefined
at configViewer (file://./.nuxt/nitro/index.mjs:119:61)
at file://./node_modules/h3/dist/index.mjs:111:24
at new Promise ()
at callHandle (file://./node_modules/h3/dist/index.mjs:108:10)
at file://./node_modules/h3/dist/index.mjs:104:12
at file://./node_modules/h3/dist/index.mjs:132:34
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async handle (file://./node_modules/h3/dist/index.mjs:572:19)
package.json excerpt:
"dependencies": {
"nuxt-edge": "latest",
"tailwindcss": "^2.2.17"
},
"devDependencies": {
"@nuxt/bridge": "npm:@nuxt/bridge-edge@^3.0.0-27245975.d1214c9",
"@nuxtjs/tailwindcss": "^4.2.0",
}
Facing issue with tailwind-config-viewer [tailwindcss package] when applying nuxt bridge.
![]()
Same issue.
I just turned this off as a workaround inside nuxt.config.js:
tailwindcss: {
// disable viewer with nuxt-bridge
viewer: false,
}
Obviously doesn't solve the underlying issue...
Can you please try v5 to see if it sovles the issue?
Having the same issue as well with nuxt-bridge
Depending on 5.0.2 tag fixed a similar issue for me.