• 카테고리

    질문 & 답변
  • 세부 분야

    데이터베이스

  • 해결 여부

    해결됨

import "/imports/startup"; 에서 문제가 발생했습니다.

23.03.05 12:08 작성 23.03.05 12:14 수정 조회수 584

0

안녕하세요, 좋은 강의로 GraphQL, MongoDB 잘 배우고 있습니다. 감사드립니다.

아래 사진과 같은 문제가 다음 강의에서 meteor run 할때 발생하는데, 찾아보다가 해결책을 찾기 힘들어 남기게 되었습니다.

스크린샷 2023-03-05 오후 12.04.54.png스크린샷 2023-03-05 오후 12.05.14.png

[실행코드 및 오류코드]

jeongmujin@jeongmujin-ui-MacBookPro smart-menu-study % disable_websockets=true meteor run

[[[[[ ~/CodingProject/smart-menu-study ]]]]]

=> Started proxy.

=> Started MongoDB.

W20230305-11:52:57.338(9)? (STDERR) /Users/jeongmujin/.meteor/packages/meteor-tool/.2.10.0.rdjekq.emwgl++os.osx.x86_64+web.browser+web.browser.legacy+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280

W20230305-11:52:57.358(9)? (STDERR) throw(ex);

W20230305-11:52:57.358(9)? (STDERR) ^

W20230305-11:52:57.359(9)? (STDERR)

W20230305-11:52:57.359(9)? (STDERR) Error: Cannot find module '/imports/startup'

W20230305-11:52:57.359(9)? (STDERR) at makeMissingError (packages/modules-runtime.js:222:12)

W20230305-11:52:57.359(9)? (STDERR) at Module.resolve (packages/modules-runtime.js:228:17)

W20230305-11:52:57.359(9)? (STDERR) at Module.moduleLink [as link] (/Users/jeongmujin/.meteor/packages/modules/.0.19.0.zlniqk.0jz8++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/@meteorjs/reify/lib/runtime/index.js:45:25)

W20230305-11:52:57.359(9)? (STDERR) at module (server/main.js:1:8)

W20230305-11:52:57.359(9)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)

W20230305-11:52:57.359(9)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)

W20230305-11:52:57.359(9)? (STDERR) at require (packages/modules-runtime.js:258:21)

W20230305-11:52:57.359(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/app/app.js:29:1

W20230305-11:52:57.359(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/boot.js:369:38

W20230305-11:52:57.359(9)? (STDERR) at Array.forEach (<anonymous>)

W20230305-11:52:57.359(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/boot.js:210:21

W20230305-11:52:57.360(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/boot.js:423:7

W20230305-11:52:57.360(9)? (STDERR) at Function.run (/Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/profile.js:256:14)

W20230305-11:52:57.360(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/boot.js:422:13

=> Exited with code: 1

=> Your application is crashing. Waiting for file change.

 

답변 2

·

답변을 작성해보세요.

0

정무진님의 프로필

정무진

질문자

2023.03.06

주로 오타문제였네요,, 잘해결했고 친절한 답변 감사합니다!

0

정무진님의 프로필

정무진

질문자

2023.03.05

다음과 같이 수정해보니 돌아가긴하는데 아래와 같은 오류가 발생하네요ㅠㅠ

[실행 및 결과 코드]

jeongmujin@jeongmujin-ui-MacBookPro smart-menu-study % disable_websockets=true meteor run

[[[[[ ~/CodingProject/smart-menu-study ]]]]]

=> Started proxy.

=> Started MongoDB.

W20230305-12:11:31.882(9)? (STDERR) (node:29188) UnhandledPromiseRejectionWarning: Error: Cannot find module '/imports/startup'

W20230305-12:11:31.908(9)? (STDERR) at makeMissingError (packages/modules-runtime.js:222:12)

W20230305-12:11:31.908(9)? (STDERR) at Module.resolve (packages/modules-runtime.js:228:17)

W20230305-12:11:31.908(9)? (STDERR) at packages/modules-runtime.js:154:31

W20230305-12:11:31.908(9)? (STDERR) at new Promise (<anonymous>)

W20230305-12:11:31.908(9)? (STDERR) at Module.prefetch (packages/modules-runtime.js:153:34)

W20230305-12:11:31.909(9)? (STDERR) at Module.dynamicImport (packages/dynamic-import.js:464:17)

W20230305-12:11:31.909(9)? (STDERR) at module (server/main.js:4:3)

W20230305-12:11:31.909(9)? (STDERR) at fileEvaluate (packages/modules-runtime.js:336:7)

W20230305-12:11:31.909(9)? (STDERR) at Module.require (packages/modules-runtime.js:238:14)

W20230305-12:11:31.909(9)? (STDERR) at require (packages/modules-runtime.js:258:21)

W20230305-12:11:31.909(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/app/app.js:29:1

W20230305-12:11:31.909(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/boot.js:369:38

W20230305-12:11:31.909(9)? (STDERR) at Array.forEach (<anonymous>)

W20230305-12:11:31.909(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/boot.js:210:21

W20230305-12:11:31.909(9)? (STDERR) at /Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/boot.js:423:7

W20230305-12:11:31.909(9)? (STDERR) at Function.run (/Users/jeongmujin/CodingProject/smart-menu-study/.meteor/local/build/programs/server/profile.js:256:14)

W20230305-12:11:31.910(9)? (STDERR) (Use node --trace-warnings ... to show where the warning was created)

W20230305-12:11:31.910(9)? (STDERR) (node:29188) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

W20230305-12:11:31.910(9)? (STDERR) (node:29188) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

=> Started your app.

=> App running at: http://localhost:3000/

 

일단 저도 처음보는 오류인 것 같습니다.

몇가지 확인을 부탁드리겠습니다

node 버전과 meteor 버전을 확인 부탁드립니다.

참고로 meteor 버전의 경우 .meteor 폴더에 reslease 파일을 열면 나와 있습니다.

그리고 괜찮으시면 현재 프로젝트 폴더를 압축해서 보내주시면 오류를 찾는데 도움이 될 것 같습니다.

자바스크립트 코드가 있어서 일반적인 메일로는 아마 전달이 힘들것 같고

구글드라이브 등에 업로드 하고 링크를 부탁드립니다.

 

 

정무진님의 프로필

정무진

질문자

2023.03.05

넵! node는 v14.21.3, meteor는 METEOR@2.10.0 입니다.

프로젝트 폴더 : https://drive.google.com/file/d/1ORCAG24Iw_7L1z3c9orpMZkydh5hvrni/view?usp=sharing

일단 보내주신 파일의 경우 몇가지 잘 못 된 점이 있었습니다.

우선 .meteor폴더에서

imports와 client폴더를 밖으로 빼야 합니다

그리고 import관련 오류가 발생하는 이유는

startup/index.js를 보면 apollo-server.js의 참조 경로가 ../가 아닌 ./ 입니다. 이유는 index.js와 apollo-server.js가 같은 폴더에 있기 때문입니다.

또 다른 오류로 api/item/collection.js에서

const item이 아니라 items입니다.

그리고 api/order/resolvers.js에서도

import Orders from "./collections"으로 변경해야 하며

여기서 import { getCurrentDate } from '/imports/utils/formatDate.js'; 도 변경해야 합니다.

한가지 힌트를 드리자면

import할 때 같은 경로의 파일을 import 할 때는 ./ 로 경로를 찾게 됩니다

그리고 해당 폴더 밖의 폴더에 접근할 때에는 ../로 접근한다는 것을 기억해 주시면 좋겠습니다.

그외에도 schema가 정의 되지 않은 문제 등도 있는데 다음 git샘플을 참조로 대조해 보시고 오류를 찾아가시면 될 것 같습니다.

https://github.com/freeseamew/smart-menu-study

채널톡 아이콘