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 Payload default components leads to loader errors #2888

Closed
ssyberg opened this issue Jun 22, 2023 · 2 comments · Fixed by #2907
Closed

Importing Payload default components leads to loader errors #2888

ssyberg opened this issue Jun 22, 2023 · 2 comments · Fixed by #2907
Assignees
Labels
status: needs-triage Possible bug which hasn't been reproduced yet

Comments

@ssyberg
Copy link
Contributor

ssyberg commented Jun 22, 2023

Link to reproduction

n/a

To Reproduce

  1. npx create-payload-app (blank app)
  2. Add code from Custom Collection List View Example (https://payloadcms.com/docs/admin/components#collections)
  3. yarn dev will fail with:
webpack built 86a0d2b7b6fdb5678bf9 in 5384ms
ERROR in ./node_modules/payload/components/views/List.ts 2:7
Module parse failed: Unexpected token (2:7)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
| export { default as List } from '../../dist/admin/components/views/collections/List/Default';
> export type { Props } from '../../dist/admin/components/views/collections/List/types';

Using Node 18.5 and have tried on payload 1.6.2, 1.9.2, and 1.10.0

Describe the Bug

Unable to import default component view

Payload Version

1.10.0

@ssyberg ssyberg added the status: needs-triage Possible bug which hasn't been reproduced yet label Jun 22, 2023
@PatrikKozak PatrikKozak self-assigned this Jun 26, 2023
@JarrodMFlesch
Copy link
Contributor

This is an odd one and I am looking into it. To get around this:

  • Go directly to the file in your node_modules and comment out this line:
    export type { Props } from '../../dist/admin/components/views/collections/List/types';
  • Save the file
  • Un-comment the line
  • Save
  • Watch webpack re-compile correctly

It has something to do with webpack and it's cache I think. Still looking into it...

Copy link

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: needs-triage Possible bug which hasn't been reproduced yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants