uuid 에러
안녕하세요.
수업을 듣던중에 같은 방법으로 uuid 라이브러리를 다운받고 실행을 하고있는데 이런 에러가 발생을 하고 있는데
혹시 어떤 부분이 문제인지 알수있을까요..?
@types/uuid 로 삭제 설치 다시 해보고 진행해도 계속 같은 에러가 발생합니다 ㅠ
<package.json>
"dependencies": {
"@types/uuid": "^8.3.4",
"graphql-request": "^5.0.0",
"graphql-tag": "^2.12.6",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-query": "^3.39.2",
"react-router-dom": "^6.4.3",
"sass": "^1.56.1"
},<handlers.ts>
import { v4 as uuid } from "uuid";
const mock_products = Array.from({ length: 20 }).map((_, i) => ({
id: uuid(),
imageUrl: `https://placeimg.com/200/150/${i + 1}`,
price: 50000,
title: `임시상품${i + 1}`,
description: `임시상세내용${i + 1}`,
createAt: new Date(1668159460287 + i * 1000 * 60 * 60 * 10).toString(),
}));<에러 내용>
[plugin:vite:import-analysis] Failed to resolve import "uuid" from "src\mocks\handlers.ts". Does the file exist?
C:/Users/home/Desktop/배포/shop/shopping/src/mocks/handlers.ts:3:27
1 | import { graphql } from "msw";
2 | import GET_PRODUCTS from "../graphql/products";
3 | import { v4 as uuid } from "uuid";
| ^
4 | const mock_products = Array.from({ length: 20 }).map((_, i) => ({
5 | id: uuid(),
at formatError (file:///C:/Users/home/Desktop/%EB%B0%B0%ED%8F%AC/shop/shopping/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:39971:46)
at TransformContext.error (file:///C:/Users/home/Desktop/%EB%B0%B0%ED%8F%AC/shop/shopping/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:39967:19)
at normalizeUrl (file:///C:/Users/home/Desktop/%EB%B0%B0%ED%8F%AC/shop/shopping/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:36835:33)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async TransformContext.transform (file:///C:/Users/home/Desktop/%EB%B0%B0%ED%8F%AC/shop/shopping/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:36968:47)
at async Object.transform (file:///C:/Users/home/Desktop/%EB%B0%B0%ED%8F%AC/shop/shopping/node_modules/vite/dist/node/chunks/dep-51c4f80a.js:40224:30)
at async loadAndTransform (file:///C:/Users/home/Desktop/%EB%B0%B0%ED%8F%AC/shop/shopping/node_modules/vite/dis
답변 1
2
공유해주신 package.json의 dependencies를 살펴보니
uuid 자체는 설치하지 않고 @types/uuid만 설치하신 것 같아요.
yarn add uuid
혹은
npm i uuid
해주세요 :)
장바구니 담기 버튼 누르면 404에러가 뜹니다
0
255
1
[useRoutes, React-Query 오류 해결방법] No QueryClient set, use QueryClientProvider to set one 에러 나시는 분 보세요 !!!
4
1210
2
깃허브에서 선생님께서 올리신 파일 받아,, 실행시켜보려했으나 안됩니다
0
343
1
상품목록페이지만들기에서 ... 막힙니다..
0
407
1
강의 시점과 지금시점이 꽤 달라진게 있는거 같아요
0
501
1
상품목록 불러오기, 장바구니 삭제 에러 질문 드립니다
0
411
1
graphqlFetcher 관련 에러와 , data 객체 정의 되지 않는 오류 질문 드립니다
0
572
2
productdetail 데이터 안불러와지고 있습니다.
1
446
1
query 에러 발생했습니다.
1
538
1
react typescript vite 설치시 오류 질문드립니다.
0
1794
2
섹션1의 1강 routes.tsx에서 에러가 발생합니다
0
813
2
routes.tsx에서 질문이 있습니다!
1
576
1
vite-plugin-next-react-router
0
1476
3
grahpqlFetcher 설명가능할까요
1
501
1
msw mocking enabled
1
790
2
[기술 질문아님]
0
551
2
products 라우팅은 되는데 cart 라우팅은 안되네요 ㅠ
0
586
2
caught Error: No QueryClient set, use ueryClientProvider 에러
13
1970
3
Heroku build관련 오류가 발생해 글 남깁니다 ㅠㅠ
0
706
1
firebase filterling 관련 질문
0
569
3
body가 json 형태가 아닌 ReadableStream 형태로 찍힙니다.
0
785
1
graphqlFetcher 관련 에러가 해결이 안됩니다. ㅠㅠ
1
673
3
MSW graphqlFetcher 에러 관련
0
478
1
graphql-tag, graphql-request 패키지를 사용하는 이유가 궁금합니다.
0
791
1





