Granite 마이그레이션 이후 PC에서 빌드 오류

npm run dev 로는 문제 없이 테스트 가능한데 빌드 하려고 하니 에러가 났습니다.
윈도우 os의 path와 관계된 문제로 보이는데 해결이 어렵네요. ㅠㅠ

npm install @granite-jsgranite-js/react-native@latest @granite-js/plugin-router@latest esbuild@latest
관련 패키지 업데이트를 시도해 봤지만 동일한 증상입니다.

C:\Users\user\Documents\GitHub\appin_flightdeal_rn>npm run build

> build
> granite build

(node:41192) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Error: [resolve-plugin] "onResolve" filter is not a valid Go regular expression: "^prelude:C:\\Users\\user\\Documents\\GitHub\\appin_flightdeal_rn\\node_modules\\react-native\\Libraries\\Core\\InitializeCore.js(?:$|\\/)"
    at C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:949:34
    at responseCallbacks.<computed> (C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:603:9)
    at handleIncomingPacket (C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:657:31)
    at Socket.readFromStdout (C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:581:7)
    at Socket.emit (node:events:524:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
Error: [resolve-plugin] "onResolve" filter is not a valid Go regular expression: "^prelude:C:\\Users\\user\\Documents\\GitHub\\appin_flightdeal_rn\\node_modules\\react-native\\Libraries\\Core\\InitializeCore.js(?:$|\\/)"
    at C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:949:34
    at responseCallbacks.<computed> (C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:603:9)
    at handleIncomingPacket (C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:657:31)
    at Socket.readFromStdout (C:\Users\user\Documents\GitHub\appin_flightdeal_rn\node_modules\@granite-js\mpack\node_modules\esbuild\lib\main.js:581:7)
    at Socket.emit (node:events:524:28)
    at addChunk (node:internal/streams/readable:561:12)
    at readableAddChunkPushByteMode (node:internal/streams/readable:512:3)
    at Readable.push (node:internal/streams/readable:392:5)
    at Pipe.onStreamRead (node:internal/stream_base_commons:189:23)
Error Build failed

C:\Users\user\Documents\GitHub\appin_flightdeal_rn>

C:\Users\user\Documents\GitHub\appin_flightdeal_rn>npm list      
flightdeal@ C:\Users\user\Documents\GitHub\appin_flightdeal_rn
├── @apps-in-toss/framework@1.0.3
├── @apps-in-toss/web-framework@1.0.3
├── @babel/core@7.23.9
├── @babel/plugin-proposal-class-properties@7.18.6
├── @babel/plugin-proposal-nullish-coalescing-operator@7.18.6
├── @babel/plugin-proposal-numeric-separator@7.18.6
├── @babel/plugin-proposal-optional-chaining@7.21.0
├── @babel/plugin-proposal-private-methods@7.18.6
├── @babel/plugin-proposal-private-property-in-object@7.21.11
├── @babel/plugin-transform-flow-strip-types@7.27.1
├── @babel/preset-env@7.28.3
├── @babel/preset-react@7.27.1
├── @babel/preset-typescript@7.27.1
├── @babel/runtime@7.18.9
├── @emotion/babel-plugin@11.13.5 extraneous
├── @emotion/cache@11.14.0 extraneous
├── @emotion/hash@0.9.2 extraneous
├── @emotion/memoize@0.9.0 extraneous
├── @emotion/react@11.14.0 extraneous
├── @emotion/serialize@1.3.3 extraneous
├── @emotion/sheet@1.4.0 extraneous
├── @emotion/unitless@0.10.0 extraneous
├── @emotion/use-insertion-effect-with-fallbacks@1.2.0 extraneous
├── @emotion/utils@1.4.2 extraneous
├── @emotion/weak-memoize@0.4.0 extraneous
├── @granite-js/native@0.1.21
├── @granite-js/plugin-router@0.1.21
├── @granite-js/react-native@0.1.21
├── @testing-library/react-native@12.9.0
├── @toss-design-system/mobile@2.1.0 extraneous
├── @toss-design-system/react-native@1.1.1
├── @types/babel__core@7.20.5
├── @types/jest@29.5.14
├── @types/node@22.18.0
├── @types/react@18.3.3
├── find-root@1.1.0 extraneous
├── jest@29.7.0
├── react-dom@18.2.0
├── react-native@0.72.6
├── react-test-renderer@18.2.0
├── react@18.2.0
├── stylis@4.2.0 extraneous
└── typescript@5.9.2

혹시 node 몇 버전 사용하실까요? node 20버전으로 다운그레이드 후 재시도 해보시겠어요?

1개의 좋아요

nvm 으로 node 22.13.1에서 20.19.5로 바꿔도 같은 오류가 났습니다.

  1. git에 올려서 그대로 맥북에 넣어 돌리면 문제 없이 돌아가고 dev와 build 모두 가능합니다.
  2. node나 팩키지 버전 동일합니다.
  3. 잘 돌아가는 거 그대로 가지고 와서 PC에 넣으면 안됩니다… ㅠㅠ

다른 PC 에서는 문제 없이 빌드 성공하고 계신지 궁금합니다.

윈도우에서도 정상적으로 빌드가 되어야하는데요 :cry:
아직 빌드가 안되실까요 ?

1개의 좋아요

다른 케이스는 없군요 ㅠㅠ 다행…입니다.

새로 프로젝트를 만들어도 같은 증상인데 제 PC에서만 생기는 문제 같습니다. dev는 잘 되기 때문에 PC에서 개발하고 귀찮긴 해도 맥에서 빌드하고 올리고 있습니다. 다시 정말 문제를 해결 해야 될 때, 다시 연구해서 문의 드리겠습니다.

이미 해결에 많은 시간을 쏟았는데 감조차 안잡혀서… ㅠㅠ

잊지 않고 팔로우업 넘 감사합니다.

이해해주셔서 감사합니다 :man_bowing:

저도 같은 에러 났는데 혹시 해결 하셨을까요??

저도 동일한 단계에서 에러났네요

해결 못했습니다. 저는 다른 컴퓨터, 맥에서 빌드 하고 있어요.

프로젝트 새로 만들기도 하고 node 처음부터 다시 세팅해보기도 했는데 많은 시간을 소비했지만 해결책을 찾지 못했습니다.

다른 PC에서는 잘된다고 하는거보니… 뭔가 완전히 새롭게 할 수준이 필요해 보여요.

가상머신이라도 설치해서 해보려구요.

도움 드리지 못해 죄송합니다, 혹시 다른 분들도 해결방법을 찾으면 여기 알려주세요!

저도 mac 에서 빌드하니 바로 되더군요

혹시 다른 windows PC 에서 하셧을때도 되셧다는 말씀이실까요?

그러면 정말 그 특정 컴퓨터만 문제가 생겼나보네요..

저도 해결 해보다가 해결책 찾으면 여기 글 남기겠습니다

답변 감사합니다