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

Exporting a named-QUERY and arbitrary default in a Cell causes duplicate entry #2456

Open
realStandal opened this issue May 5, 2021 · 5 comments
Labels
bug/confirmed We have confirmed this is a bug topic/cells

Comments

@realStandal
Copy link
Collaborator

realStandal commented May 5, 2021

This bug was encountered on Redwood 0.31.2, but I was facing it on 0.31.0; I can't confirm if it was also prior to that.

I'm building a Cell component and would like to control the default export myself (to get typings). If I have a named export QUERY, it causes the following:

Failed to compile.
Module parse failed: Duplicate export 'default' (47:7)
src/components/Organization/CurrentOrganizationCell/CurrentOrganizationCell.js 47:7
File was processed with these loaders:
 * ../node_modules/@pmmmwh/react-refresh-webpack-plugin/loader/index.js
 * ../node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
| 
| export default CurrentOrganizationCell;
> export default createCell({
|   Loading,
|   Empty,

If I remove or rename QUERY, the createCell HOC is not added. I haven't tested each of the other exports, but I have mutation cells which have their own default, no QUERY, and work as-expected.

@peterp
Copy link
Contributor

peterp commented May 12, 2021

Hey @realStandal,

This will be fixed shortly.

@peterp peterp added the bug/confirmed We have confirmed this is a bug label May 12, 2021
@Tobbe Tobbe added the bug label May 14, 2021
@realStandal realStandal changed the title Exporting a named-QUERY and arbitrary default causes duplicate entry Exporting a named-QUERY and arbitrary default in a Cell causes duplicate entry May 18, 2021
@jtoar jtoar added this to Needs confirmation in Triage Jun 10, 2021
@jtoar jtoar removed this from Needs confirmation in Triage Dec 13, 2021
@jtoar
Copy link
Collaborator

jtoar commented Dec 13, 2021

but I have mutation cells which have their own default, no QUERY, and work as-expected.

@realStandal Mutation cells—sounds super interesting! Would love to see an example if you don't mind sharing.

@realStandal
Copy link
Collaborator Author

realStandal commented Dec 14, 2021

@jtoar I have to dig for it in an older project, but definitely will share - maybe as a forum post so it can be found easier. I've honestly been leaning on the toast.promise(mutate) convention recently.

And thank you for all the work I've seen you do towards my issues/suggestions the past few days! ❤️ I'm sure there is tons more I haven't seen that I'll get to benefit from.

@realStandal
Copy link
Collaborator Author

@jtoar My comment on the forums has the best/most up-to-date variation. Definitely a first draft, though.

@jtoar
Copy link
Collaborator

jtoar commented Dec 14, 2021

@realStandal Thanks! Just trying to go over everything again now that we're in the v1 RC phase. Feel free to ping me if there's something you want bumped that I don't get to!

And re mutation Cells: thanks for that link I'll take a look over there and continue the conversation

@jtoar jtoar removed the v1/priority label May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/confirmed We have confirmed this is a bug topic/cells
Projects
Status: Backlog
Development

No branches or pull requests

4 participants