Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Importing from uuid no longer works when upgrading from vite 3.2.4 to 4.0.1 #11378

Closed
7 tasks done
randyridge opened this issue Dec 14, 2022 · 4 comments
Closed
7 tasks done

Comments

@randyridge
Copy link

Describe the bug

Someone posted an issue on the sveltekit repo with details and a repro, I found that it was caused by only updating vite from 3 to 4 which is a dependency for sveltekit 1.0...

I'm reposting the sveltekit OP's details to satisfy the bug report...

import * as uuid from 'uuid' import { v4 as uuidv4 } from "uuid"; export const GET = async () => { // console.log('uuid', uuid.v4()) console.log('uuidv4', uuidv4()) }

Cannot read properties of undefined (reading 'v4') TypeError: Cannot read properties of undefined (reading 'v4') at GET (/Users/thangvu/repos/github/sveltekit-repro-uuid/src/routes/api/test/+server.js:5:24) at render_endpoint (file:///Users/thangvu/repos/github/sveltekit-repro-uuid/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.584_svelte@3.54.0+vite@4.0.1/node_modules/@sveltejs/kit/src/runtime/server/endpoint.js:45:26) at resolve (file:///Users/thangvu/repos/github/sveltekit-repro-uuid/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.584_svelte@3.54.0+vite@4.0.1/node_modules/@sveltejs/kit/src/runtime/server/index.js:398:23) at async respond (file:///Users/thangvu/repos/github/sveltekit-repro-uuid/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.584_svelte@3.54.0+vite@4.0.1/node_modules/@sveltejs/kit/src/runtime/server/index.js:261:20) at async file:///Users/thangvu/repos/github/sveltekit-repro-uuid/node_modules/.pnpm/@sveltejs+kit@1.0.0-next.584_svelte@3.54.0+vite@4.0.1/node_modules/@sveltejs/kit/src/exports/vite/dev/index.js:480:22

Relevant sveltekit issue

Reproduction

https://github.com/ThangHuuVu/sveltekit-uuid-reproduction

Steps to reproduce

No response

System Info

### System Info


System:
    OS: macOS 12.5.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 85.08 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.17.0 - ~/.nvm/versions/node/v16.17.0/bin/node
    Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.0/bin/yarn
    npm: 8.15.0 - ~/.nvm/versions/node/v16.17.0/bin/npm
  Browsers:
    Chrome: 108.0.5359.98
    Firefox: 107.0.1
    Safari: 15.6.1
    Safari Technology Preview: 16.0

Used Package Manager

npm

Logs

No response

Validations

@randyridge
Copy link
Author

I delegate this issue to #11385 which has a better vite-specific repro.

@nitedani
Copy link

I think this is a duplicate of #11299

@uhillbom
Copy link

Encountered same issue updating to Vite 4 and Sveltekit 1.0.1
uuid stopped working.

@bluwy
Copy link
Member

bluwy commented Dec 18, 2022

Let's continue the discussion at #11385

@bluwy bluwy closed this as not planned Won't fix, can't repro, duplicate, stale Dec 18, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants