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?]: FatalErrorPage path is incorrect after scaffolding app #9244

Open
1 task
standuprey opened this issue Sep 30, 2023 · 4 comments
Open
1 task

[Bug?]: FatalErrorPage path is incorrect after scaffolding app #9244

standuprey opened this issue Sep 30, 2023 · 4 comments
Assignees
Labels
bug/confirmed We have confirmed this is a bug

Comments

@standuprey
Copy link
Contributor

standuprey commented Sep 30, 2023

What's not working?

Given a newly created app yarn create redwood-app test with typescript (problem might also be with js)
when I open App.tsx in VS Code after installing the packages,
then on line 4, it says
import FatalErrorPage from 'src/pages/FatalErrorPage' showing red squiggles
instead of
import FatalErrorPage from 'src/pages/FatalErrorPage/FatalErrorPage'

How do we reproduce the bug?

No response

What's your environment? (If it applies)

System:
    OS: macOS 13.2.1
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 18.16.0 - /private/var/folders/g7/0v2mwcd50dv822c6142lth1h0000gp/T/xfs-ffc7c61b/node
    Yarn: 3.6.3 - /private/var/folders/g7/0v2mwcd50dv822c6142lth1h0000gp/T/xfs-ffc7c61b/yarn
  Databases:
    SQLite: 3.39.5 - /usr/bin/sqlite3
  Browsers:
    Chrome: 117.0.5938.132
    Safari: 16.3
  npmPackages:
    @redwoodjs/core: 6.3.1 => 6.3.1

Are you interested in working on this?

  • I'm interested in working on this
@standuprey standuprey added the bug/needs-info More information is needed for reproduction label Sep 30, 2023
@Josh-Walker-GM
Copy link
Collaborator

Josh-Walker-GM commented Oct 1, 2023

Hey @standup75, thanks for this one. Could you confirm if running yarn rw g types makes the red squiggles go away for you?

This would make sense since if the node modules aren't installed at the time the project is created then the type generation won't take place and you'll get red squiggles. I guess it would do no harm to simply add another level of /FatalErrorPage but I'll let others weigh in on if that goes against some sort of typical style we'd recommend using.

@Josh-Walker-GM Josh-Walker-GM added bug/confirmed We have confirmed this is a bug and removed bug/needs-info More information is needed for reproduction labels Oct 1, 2023
@standuprey
Copy link
Contributor Author

standuprey commented Oct 1, 2023

Thanks for looking into this so promptly.
yarn rw g types does fix the red squiggle, I can see the magic happening in .redwood/types/mirror/web/src/pages/FatalErrorPage/index.d.ts.
Apart from being undocumented, I think the problem with this is 2 fold:

  • The meaning of the import is quite unclear, I need to know what the type generator is doing
  • Jumping in the source on the line import FatalErrorPage from 'src/pages/FatalErrorPage' gets me to .redwood/types/mirror/web/src/pages/FatalErrorPage/index.d.ts which is NEVER what I want

@Josh-Walker-GM
Copy link
Collaborator

Okay so that merged PR mentioned above should fix:

Jumping in the source on the line import FatalErrorPage from 'src/pages/FatalErrorPage' gets me to .redwood/types/mirror/web/src/pages/FatalErrorPage/index.d.ts which is NEVER what I want

My next question would be can we in some way ship with the generated types for the blank project we copy over running yarn create redwood-app? This would mean the red squiggles were never there in the first place even before the first time yarn rw g types is run. @jtoar - Is there any reason I'm not aware of that we don't ship with a pre-populated .redwood/types folder?

@jtoar
Copy link
Contributor

jtoar commented Oct 26, 2023

@Josh-Walker-GM good idea, it may be possible. I'll have a look

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
Projects
None yet
Development

No branches or pull requests

3 participants