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

Errors with with-next-seo example #10333

Closed
zhe opened this issue Jan 30, 2020 · 1 comment · Fixed by #10335, evantahler/next-static-hosting#3 or grouparoo/next-plugins-example#3 · May be fixed by shahinalzahrani/docs#1
Closed

Errors with with-next-seo example #10333

zhe opened this issue Jan 30, 2020 · 1 comment · Fixed by #10335, evantahler/next-static-hosting#3 or grouparoo/next-plugins-example#3 · May be fixed by shahinalzahrani/docs#1

Comments

@zhe
Copy link
Contributor

zhe commented Jan 30, 2020

Examples bug report

Example name

with-next-seo GitHub link

Describe the bug

On browser:

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.

On terminal:

Warning: React.createElement: 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.

Check your code at _app.js:27.
    in MyApp
    in Unknown
    in Context.Provider
    in Context.Provider
    in Context.Provider
    in AppContainer
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.
...

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

  1. Run npm init next-app --example with-next-seo next-seo-app
  2. Run cd next-seo-app && npm run dev

Expected behavior

Run the application without errors.

Screenshots

If applicable, add screenshots to help explain your problem.

System information

  • OS: macOS
  • Browser: Firefox
  • Version of Next.js: latest

Additional context

I am going to make a PR to fix:

  • When import 'next-seo' package, need to use object destructuring assignment syntax.
  • When to use a default SEO config, need to use spread syntax in _app.js
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.