ryoppippi / unplugin-typia

unplugin for Typia with an extra Bun plugin 🫶
https://jsr.io/@ryoppippi/unplugin-typia
Other
37 stars 6 forks source link

Next.js / Transformation does not work correctly with versions other than 0.5.1. #187

Closed localer closed 1 month ago

localer commented 1 month ago
// package.json
{
  "dependencies": {
    "@ryoppippi/unplugin-typia": "npm:@jsr/ryoppippi__unplugin-typia@0.5.1",
    "next": "^15.0.0-rc.0",
    "react": "^19.0.0-rc-fb9a90fa48-20240614",
    "react-dom": "^19.0.0-rc-fb9a90fa48-20240614",
    "typia": "^6.4.3"
  }
}

(※next.jsとreactは、canaryです)


// エラーログ
@localer ➜ /workspaces/lupus (refactoring-1) $ npm run dev

> lupus@0.1.0 dev
> next dev

(node:3984) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
(node:4000) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
  ▲ Next.js 15.0.0-rc.0
  - Local:        http://localhost:3000
  - Environments: .env.local

 ✓ Starting...
warning ../package.json: No license field

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ✓ Ready in 3.5s

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ○ Compiling / ...
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /workspaces/lupus/node_modules/mlly/dist/index.mjs for build dependencies failed at 'import(dataURL)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.

 ╭──────────────────────────────────╮
 │                                  │
 │  [unplugin-typia] Cache enabled  │
 │                                  │
 ╰──────────────────────────────────╯

 ✓ Compiled / in 13.1s (2156 modules)
 ⨯ node_modules/typia/lib/module.mjs (157:1) @ halt
 ⨯ Error: Error on typia.is(): no transform has been configured. Read and follow https://typia.io/docs/setup please.
    at eval (./src/env/client.ts:20:41)
    at (ssr)/./src/env/client.ts (/workspaces/lupus/.next/server/app/page.js:184:1)
    at __webpack_require__ (/workspaces/lupus/.next/server/webpack-runtime.js:33:42)
    at eval (./src/components/layout/headers/menu.tsx:7:69)
    at (ssr)/./src/components/layout/headers/menu.tsx (/workspaces/lupus/.next/server/app/page.js:118:1)
    at Object.__webpack_require__ [as require] (/workspaces/lupus/.next/server/webpack-runtime.js:33:42)
digest: "517447350"
  155 |  */
  156 | function halt(name) {
> 157 |     throw new Error(`Error on typia.${name}(): no transform has been configured. Read and follow https://typia.io/docs/setup please.`);
      | ^
  158 | }
  159 |
  160 | export { assertPure as assert, assertEqualsPure as assertEquals, assertGuardPure as assertGuard, assertGuardEqualsPure as assertGuardEquals, createAssertPure as createAssert, createAssertEqualsPure as createAssertEquals, createAssertGuardPure as createAssertGuard, createAssertGuardEqualsPure as createAssertGuardEquals, createEqualsPure as createEquals, createIsPure as createIs, createRandomPure as createRandom, createValidatePure as createValidate, createValidateEqualsPure as createValidateEquals, equalsPure as equals, isPure as is, randomPure as random, validatePure as validate, validateEqualsPure as validateEquals };
 GET / 500 in 13753ms
<w> [webpack.cache.PackFileCacheStrategy/webpack.FileSystemInfo] Parsing of /workspaces/lupus/node_modules/mlly/dist/index.mjs for build dependencies failed at 'import(dataURL)'.
<w> Build dependencies behind this expression are ignored and might cause incorrect cache invalidation.
ryoppippi commented 1 month ago

Hi, I need a full reproduction repository because idk this error comes from

So I want you to create reproduction repo to identify

ryoppippi commented 1 month ago

@localer Any updates?

ryoppippi commented 1 month ago

We temporarily close this due to the lack of enough information. Please provide a minimal reproduction to reopen the issue. Thanks.