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

[BUG] importing UUID causes an 'Element type is invalid' error #651

Closed
2 tasks done
BeetrootShoulders opened this issue Aug 24, 2022 · 4 comments
Closed
2 tasks done
Labels

Comments

@BeetrootShoulders
Copy link

Before you begin...

  • I have searched the existing issues
  • I am not using version 13.x of node (if so, please upgrade)

Description of the problem

Importing uuid into a Next.js component using the method in the docs:

import { v4 as uuidv4 } from "uuid";

causes an error:

Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

Recipe for reproducing

Import UUID into a Next component.

Additional information

No response

Environment

System:
    OS: Windows 10 10.0.22000
    CPU: (12) x64 Intel(R) Core(TM) i5-10400 CPU @ 2.90GHz
    Memory: 1.33 GB / 7.75 GB
  Binaries:
    Node: 16.14.2 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.15 - C:\Program Files\nodejs\yarn.CMD
    npm: 8.5.0 - C:\Program Files\nodejs\npm.CMD
  Browsers:
    Edge: Spartan (44.22000.120.0), Chromium (104.0.1293.63)
    Internet Explorer: 11.0.22000.120
  npmPackages:
    @babel/preset-react: ^7.18.6 => 7.18.6 
    @sanity/client: ^3.3.3 => 3.3.3 
    @sanity/image-url: ^1.0.1 => 1.0.1 
    autoprefixer: ^10.4.8 => 10.4.8 
    eslint: 8.22.0 => 8.22.0 
    eslint-config-next: 12.2.5 => 12.2.5 
    moment: ^2.29.4 => 2.29.4 
    next: 12.2.5 => 12.2.5 
    postcss: ^8.4.16 => 8.4.16 
    react: 18.2.0 => 18.2.0 
    react-dom: 18.2.0 => 18.2.0 
    tailwindcss: ^3.1.8 => 3.1.8 
    uuid: ^8.3.2 => 8.3.2 
@broofa broofa closed this as completed Aug 24, 2022
@BeetrootShoulders
Copy link
Author

Very helpful. That's as minimal and complete as it gets. I do nothing but import uuid into a component, do nothing else with it, and the error gets thrown.

@broofa
Copy link
Member

broofa commented Aug 24, 2022

@broofa
Copy link
Member

broofa commented Aug 24, 2022

To be clear, it's the "complete" and "verifiable" part of things that's lacking here. Feel free to fork that CodeSandbox project to put together a test case that demonstrates the problem. Failing that, this isn't an actionable issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants