htmlstreamofficial / preline

Preline UI is an open-source set of prebuilt UI components based on the utility-first Tailwind CSS framework.
https://preline.co
Other
4.9k stars 309 forks source link

Nextjs 15 | ReferenceError: self is not defined #503

Open ruizehung opened 1 week ago

ruizehung commented 1 week ago

Summary

Nextjs 15 | ReferenceError: self is not defined

Steps to Reproduce

I create a next js 15 app using https://create.t3.gg/. And then I install Preline following https://preline.co/docs/frameworks-nextjs.html. Then next dev error out with ReferenceError: self is not defined.

Steps to reproduce:

  1. Clone https://github.com/ruizehung/debug-turbo
  2. Run pnpm i
  3. Runpnpm run dev
  4. See error

Demo Link

https://github.com/ruizehung/debug-turbo

Expected Behavior

Preline should work with Nextjs 15 created from T3 stack

Actual Behavior

Full log:

debug-turbo git:(main) ✗ pnpm run dev                                                      

> debug-turbo@0.1.0 dev /Users/rayhung/Dev/debug-turbo
> next dev

 ⚠ Port 3000 is in use, trying 3001 instead.
   ▲ Next.js 15.0.3
   - Local:        http://localhost:3001
   - Environments: .env

 ✓ Starting...
 ✓ Ready in 1041ms
 ○ Compiling / ...
 ⨯ ./src/styles/globals.css.webpack[javascript/auto]!=!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./src/styles/globals.css
ReferenceError: self is not defined
Import trace for requested module:
./src/styles/globals.css.webpack[javascript/auto]!=!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./src/styles/globals.css
./src/styles/globals.css
 ⨯ ./src/styles/globals.css.webpack[javascript/auto]!=!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./src/styles/globals.css
ReferenceError: self is not defined
Import trace for requested module:
./src/styles/globals.css.webpack[javascript/auto]!=!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[2]!./node_modules/.pnpm/next@15.0.3_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[13].oneOf[10].use[3]!./src/styles/globals.css
./src/styles/globals.css
 GET / 500 in 1434ms

Screenshots

image