jotaijs / jotai-optics

Jotai integration library for optics-ts
MIT License
27 stars 6 forks source link

ReferenceError: t is not defined on Next.js 14.1 #14

Open NicholasG04 opened 7 months ago

NicholasG04 commented 7 months ago

Seems to be an issue with jotai-optics on Next.js 14.1. It was working fine in Next.js 14.0. Would be grateful for any advice please

Unhandled Runtime Error
ReferenceError: t is not defined

Call Stack
eval
(app-pages-browser)/./node_modules/.pnpm/jotai-optics@0.3.1_jotai@2.6.2_optics-ts@2.4.1/node_modules/jotai-optics/dist/index.modern.js (19:37)
(app-pages-browser)/./node_modules/.pnpm/jotai-optics@0.3.1_jotai@2.6.2_optics-ts@2.4.1/node_modules/jotai-optics/dist/index.modern.js
file:///workspaces/myworkspace/.next/static/chunks/app/(site)/page.js (237:1)
options.factory
file:///workspaces/myworkspace/.next/static/chunks/webpack.js (716:31)
__webpack_require__
file:///workspaces/myworkspace/.next/static/chunks/webpack.js (37:33)
fn
file:///workspaces/myworkspace/.next/static/chunks/webpack.js (371:21)
eval
(app-pages-browser)/./src/lib/store.ts (11:70)
(app-pages-browser)/./src/lib/store.ts
file:///workspaces/myworkspace/.next/static/chunks/app/(site)/page.js (973:1)
dai-shi commented 7 months ago

Can we get any advice from Next.js team, about what we should do?

Does using v0.3.2 change anything?

NicholasG04 commented 7 months ago

No change of v0.3.2 that I can see. Thanks

dai-shi commented 7 months ago

It shouldn't be jotai-optics only issue. Maybe it happens to many jotai-* packages.

Cielquan commented 7 months ago

Are you using the @swc-jotai/react-refresh plugin? Then maybe this is related: https://github.com/pmndrs/swc-jotai/issues/24

NicholasG04 commented 7 months ago

Nope, not using SWC

FinnRG commented 6 months ago

Had the same issue. Removing swc-jotai/react-refresh and the .next folder solved it for now.