Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 30, 2025

From @cprecioso:

Vite's React Fast Refresh requires files to export only React components. auth/forms/Auth.tsx was exporting both the Auth component and the AuthContext, causing HMR to fall back to full page reloads. Now we split it.

Co-authored-by: cprecioso <511681+cprecioso@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix incompatible exports in Auth.tsx for React Fast Refresh Split AuthContext export from Auth.tsx for React Fast Refresh compatibility Oct 30, 2025
Copilot AI requested a review from cprecioso October 30, 2025 17:25
Copilot finished work on behalf of cprecioso October 30, 2025 17:25
@cprecioso
Copy link
Member

@copilot
Good. Now update waspc/src/Wasp/Generator/SdkGenerator/Auth/AuthFormsG.hs to generate the new AuthContext template file.

Co-authored-by: cprecioso <511681+cprecioso@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 31, 2025

@copilot
Good. Now update waspc/src/Wasp/Generator/SdkGenerator/Auth/AuthFormsG.hs to generate the new AuthContext template file.

Done! Added the AuthContext.tsx generation to the genAuthForms function in commit a2aff86.

Copilot finished work on behalf of cprecioso October 31, 2025 08:13
@cprecioso
Copy link
Member

@copilot
Looking good. Run cd waspc && ./run test:waspc:e2e:accept-all to update the snapshots and commit and push them to the PR.
Then run cd waspc && ./run test to make sure all the tests pass.
If any problems appear, report back.

Co-authored-by: cprecioso <511681+cprecioso@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Oct 31, 2025

@copilot
Looking good. Run cd waspc && ./run test:waspc:e2e:accept-all to update the snapshots and commit and push them to the PR.
Then run cd waspc && ./run test to make sure all the tests pas...

Updated the e2e kitchen-sink golden snapshot with the new AuthContext.tsx file in commit e8ea1f0. The e2e:accept-all test had issues with npm process management, but I've manually verified and updated the kitchen-sink snapshot. Now running full tests...

@copilot
Looking good. Run cd waspc && ./run test:waspc:e2e:accept-all to update the snapshots and commit and push them to the PR.
Then run cd waspc && ./run test to make sure all the tests pas...

Test results:

  • ✅ Unit tests (waspc-tests): PASS
  • ✅ Manual verification: kitchen-sink example successfully compiled with AuthContext.tsx generated correctly
  • ❌ E2e tests: Failed due to npm process management issue ("npm: readCreateProcessWithExitCode: chdir: invalid argument (Bad file descriptor)")

The e2e test failure appears to be an environment issue unrelated to the Auth changes. The unit tests pass and manual compilation shows the AuthContext.tsx file is generated correctly with proper imports in Auth.tsx and all consumer files.

Commits: e8ea1f0

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • app.posthog.com
    • Triggering command: /home/REDACTED/work/wasp/wasp/waspc/dist-newstyle/build/x86_64-linux/ghc-9.0.2/waspc-0.18.1/x/wasp-cli/build/wasp-cli/wasp-cli compile (dns block)
    • Triggering command: wasp-cli compile (dns block)
  • checkpoint.prisma.io
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/work/wasp/wasp/waspc/e2e-tests/snapshots/wasp-compile-current/wasp-app/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;5.19.1&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2025-10-31T08:37:30Z&#34;,&#34;project_hash&#34;:&#34;7878793b&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/wasp/wasp/waspc/e2e-tests/snapshots/wasp-compile-current/wasp-app/node_modules/prisma/build/index.js&#34;,&#34;cli_path_hash&#34;:&#34;6115518f&#34;,&#34;endpoint&#34;:&#34;REDACTED&#34;,&#34;disable&#34;:false,&#34;arch&#34;:&#34;x64&#34;,&#34;os&#34;:&#34;linux&#34;,&#34;node_version&#34;:&#34;v22.21.1&#34;,&#34;ci&#34;:true,&#34;ci_name&#34;:&#34;GitHub Actions&#34;,&#34;command&#34;:&#34;generate --postinstall \&#34;UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING\&#34;&#34;,&#34;schema_providers&#34;:[&#34;sqlite&#34;],&#34;schema_preview_features&#34;:[],&#34;schema_generators_providers&#34;:[&#34;prisma-client-js&#34;],&#34;cache_file&#34;:&#34;/home/REDACTED/.cache/checkpoint-nodejs/prisma-6115518f&#34;,&#34;cache_duration&#34;:43200000,&#34;remind_duration&#34;:172800000,&#34;force&#34;:false,&#34;timeout&#34;:5000,&#34;unref&#34;:true,&#34;child_path&#34;:&#34;/home/REDACTED/work/wasp/wasp/waspc/e2e-tests/snapshots/wasp-compile-current/wasp-app/node_modules/prisma/build/child&#34;,&#34;client_event_id&#34;:&#34;&#34;,&#34;previous_client_event_id&#34;:&#34;&#34;,&#34;check_if_update_available&#34;:true} (dns block)
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/work/wasp/wasp/examples/kitchen-sink/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;5.19.1&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2025-10-31T08:39:49Z&#34;,&#34;project_hash&#34;:&#34;dc571d5d&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/wasp/wasp/examples/kitchen-sink/node_modules/prisma/build/index.js&#34;,&#34;cli_path_hash&#34;:&#34;ecb59fd9&#34;,&#34;endpoint&#34;:&#34;REDACTED&#34;,&#34;disable&#34;:false,&#34;arch&#34;:&#34;x64&#34;,&#34;os&#34;:&#34;linux&#34;,&#34;node_version&#34;:&#34;v22.21.1&#34;,&#34;ci&#34;:true,&#34;ci_name&#34;:&#34;GitHub Actions&#34;,&#34;command&#34;:&#34;generate --postinstall \&#34;UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING\&#34;&#34;,&#34;schema_providers&#34;:[&#34;postgresql&#34;],&#34;schema_preview_features&#34;:[],&#34;schema_generators_providers&#34;:[&#34;prisma-client-js&#34;],&#34;cache_file&#34;:&#34;/home/REDACTED/.cache/checkpoint-nodejs/prisma-ecb59fd9&#34;,&#34;cache_duration&#34;:43200000,&#34;remind_duration&#34;:172800000,&#34;force&#34;:false,&#34;timeout&#34;:5000,&#34;unref&#34;:true,&#34;child_path&#34;:&#34;/home/REDACTED/work/wasp/wasp/examples/kitchen-sink/node_modules/prisma/build/child&#34;,&#34;client_event_id&#34;:&#34;&#34;,&#34;previous_client_event_id&#34;:&#34;&#34;,&#34;check_if_update_available&#34;:true} (dns block)
    • Triggering command: /home/REDACTED/.nvm/versions/node/v22.21.1/bin/node /home/REDACTED/work/wasp/wasp/waspc/e2e-tests/snapshots/wasp-compile-current/wasp-app/node_modules/prisma/build/child {&#34;product&#34;:&#34;prisma&#34;,&#34;version&#34;:&#34;5.19.1&#34;,&#34;cli_install_type&#34;:&#34;local&#34;,&#34;information&#34;:&#34;&#34;,&#34;local_timestamp&#34;:&#34;2025-10-31T08:45:14Z&#34;,&#34;project_hash&#34;:&#34;7878793b&#34;,&#34;cli_path&#34;:&#34;/home/REDACTED/work/wasp/wasp/waspc/e2e-tests/snapshots/wasp-compile-current/wasp-app/node_modules/prisma/build/index.js&#34;,&#34;cli_path_hash&#34;:&#34;6115518f&#34;,&#34;endpoint&#34;:&#34;REDACTED&#34;,&#34;disable&#34;:false,&#34;arch&#34;:&#34;x64&#34;,&#34;os&#34;:&#34;linux&#34;,&#34;node_version&#34;:&#34;v22.21.1&#34;,&#34;ci&#34;:true,&#34;ci_name&#34;:&#34;GitHub Actions&#34;,&#34;command&#34;:&#34;generate --postinstall \&#34;UNABLE_TO_FIND_POSTINSTALL_TRIGGER__ENVAR_MISSING\&#34;&#34;,&#34;schema_providers&#34;:[&#34;sqlite&#34;],&#34;schema_preview_features&#34;:[],&#34;schema_generators_providers&#34;:[&#34;prisma-client-js&#34;],&#34;cache_file&#34;:&#34;/home/REDACTED/.cache/checkpoint-nodejs/prisma-6115518f&#34;,&#34;cache_duration&#34;:43200000,&#34;remind_duration&#34;:172800000,&#34;force&#34;:false,&#34;timeout&#34;:5000,&#34;unref&#34;:true,&#34;child_path&#34;:&#34;/home/REDACTED/work/wasp/wasp/waspc/e2e-tests/snapshots/wasp-compile-current/wasp-app/node_modules/prisma/build/child&#34;,&#34;client_event_id&#34;:&#34;&#34;,&#34;previous_client_event_id&#34;:&#34;&#34;,&#34;check_if_update_available&#34;:true} (dns block)
  • iojs.org
    • Triggering command: curl --fail --compressed -q -L -s REDACTED -o - (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of cprecioso October 31, 2025 08:46
@cprecioso cprecioso marked this pull request as ready for review November 3, 2025 09:40
@infomiho infomiho self-requested a review November 3, 2025 09:41
@infomiho
Copy link
Contributor

infomiho commented Nov 4, 2025

We extracted this exact piece of logic into a separate lib in this PR: #2989 so this change might not be necessary after we merge the libs PR. I'll keep it open until then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

auth/forms/Auth.tsx exports are incompatible with React Fast Refresh

3 participants