Skip to content

Commit

Permalink
fix(node,tailwindcss): Downgrade node { 23 => 22 } to avoid error
Browse files Browse the repository at this point in the history
Why?:
Because the following error will happen when running server.

```bash
$ npm run dev

> [email protected] dev
> vite

  VITE v5.4.9  ready in 310 ms

  ➜  Local:   http://localhost:5173/
  ➜  Network: use --host to expose
  ➜  press h + enter to show help
(node:59826) ExperimentalWarning: Support for loading ES Module in
require() is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
file:///home/toor/repos/github.com/rnazmo/my-web-tools/tailwind.config.js:56
  plugins: [require("tailwindcss-animate")],
           ^

ReferenceError: require is not defined
    at
file:///home/toor/repos/github.com/rnazmo/my-web-tools/tailwind.config.js:56:12
    at ModuleJobSync.runSync
(node:internal/modules/esm/module_job:367:35)
    at ModuleLoader.importSyncForRequire
(node:internal/modules/esm/loader:325:47)
    at loadESMFromCJS (node:internal/modules/cjs/loader:1392:24)
    at Module._compile (node:internal/modules/cjs/loader:1525:5)
    at Object..js (node:internal/modules/cjs/loader:1680:16)
    at Module.load (node:internal/modules/cjs/loader:1328:32)
    at Function._load (node:internal/modules/cjs/loader:1138:12)
    at TracingChannel.traceSync (node:diagnostics_channel:315:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:218:24)
    at Module.require (node:internal/modules/cjs/loader:1350:12)
    at require (node:internal/modules/helpers:138:16)
    at
/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/tailwindcss/lib/lib/load-config.js:54:27
    at loadConfig
(/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/tailwindcss/lib/lib/load-config.js:58:6)
    at getTailwindConfig
(/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:71:116)
    at
/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/tailwindcss/lib/lib/setupTrackingContext.js:100:92
    at
/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/tailwindcss/lib/processTailwindFeatures.js:46:11
    at plugins
(/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/tailwindcss/lib/plugin.js:38:69)
    at LazyResult.runOnRoot
(/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/postcss/lib/lazy-result.js:329:16)
    at LazyResult.runAsync
(/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/postcss/lib/lazy-result.js:258:26)
    at LazyResult.async
(/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/postcss/lib/lazy-result.js:160:30)
    at LazyResult.then
(/home/toor/repos/github.com/rnazmo/my-web-tools/node_modules/postcss/lib/lazy-result.js:404:17)

Node.js v23.0.0
```

What I did:

```bash
$ mise use node@22
✔mise ~/repos/github.com/rnazmo/my-web-tools/.mise.toml tools:
[email protected]
$ node --version
v22.9.0
```

Ref:
    npm/cli#7857
    https://mise.jdx.dev/cli/use.html

See also:
    https://tailwindcss.com/docs/configuration
  • Loading branch information
rnazmo committed Oct 21, 2024
1 parent 95712c9 commit 83859a0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion .mise.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
[tools]
node = "23"
node = "22"

0 comments on commit 83859a0

Please sign in to comment.