Skip to content

bug: Default LIST template has an error in vite.config.ts #30362

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

Open
3 tasks done
ptallett opened this issue Apr 16, 2025 · 7 comments
Open
3 tasks done

bug: Default LIST template has an error in vite.config.ts #30362

ptallett opened this issue Apr 16, 2025 · 7 comments
Labels

Comments

@ptallett
Copy link

Prerequisites

Ionic Framework Version

v8.x

Current Behavior

Create a default project with the LIST template (not using web wizard)
vite.config.ts has an error that @vitejs/plugin-react has no default export

import react from '@vitejs/plugin-react'
Module '"d:/test/node_modules/@vitejs/plugin-react/dist/index"' has no default export

Expected Behavior

Expected: No compile errors

Steps to Reproduce

Create a default project with the LIST template (not using web wizard)
vite.config.ts has an error that @vitejs/plugin-react has no default export

Code Reproduction URL

xxx

Ionic Info

D:\Test>ionic info
[WARN] Error loading @capacitor/ios package.json: Error: Cannot find module
'@capacitor/ios/package.json'

   Require stack:
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic

[WARN] Error loading @capacitor/android package.json: Error: Cannot find module
'@capacitor/android/package.json'

   Require stack:
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\lib\project\index.js
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\lib\index.js
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\index.js
   - C:\Users\ptallett\AppData\Roaming\npm\node_modules\@ionic\cli\bin\ionic

Ionic:

Ionic CLI : 7.2.1 (C:\Users\ptallett\AppData\Roaming\npm\node_modules@ionic\cli)
Ionic Framework : @ionic/react 8.5.4

Capacitor:

Capacitor CLI : 7.2.0
@capacitor/android : not installed
@capacitor/core : 7.2.0
@capacitor/ios : not installed

Utility:

cordova-res : not installed globally
native-run : 2.0.1

System:

NodeJS : v20.9.0 (C:\Program Files\nodejs\node.exe)
npm : 10.1.0
OS : Windows 10

D:\Test>

Additional Information

No response

@ionitron-bot ionitron-bot bot added the triage label Apr 16, 2025
@brandyscarney
Copy link
Member

Thanks for the issue! Please provide steps to reproduce this. I am unable to reproduce by running ionic start, selecting React and list, then changing to the directory and running ionic serve.

Image

@brandyscarney brandyscarney added needs: reply the issue needs a response from the user and removed triage labels Apr 24, 2025
@ptallett
Copy link
Author

I ran ionic start, selected react and list, did npm install, then opened in vscode.

Image

Note the error seems only to be in vscode, the project builds and runs just fine

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Apr 25, 2025
@ptallett
Copy link
Author

I have 50 or so other React/TS/Vite projects on this machine and all are fine.

@brandyscarney
Copy link
Member

Thanks for the reply! I tried disabling all of my extensions, but I'm still unable to reproduce the issue. I also had a coworker try, and he wasn't able to reproduce it either. Here's my VSCode info:

Version: 1.99.3 (Universal)
Commit: 17baf841131aa23349f217ca7c570c76ee87b957
Date: 2025-04-15T23:18:46.076Z
Electron: 34.3.2
ElectronBuildId: 11161073
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Darwin arm64 24.1.0

Could you share your version info, or see if anything here stands out? Also, does disabling extensions or reloading the window resolve the error on your end?

@brandyscarney brandyscarney added the needs: reply the issue needs a response from the user label Apr 25, 2025
@ionitron-bot ionitron-bot bot removed the triage label Apr 25, 2025
@ptallettms
Copy link

ptallettms commented Apr 26, 2025

Version: 1.99.2 (user setup)
Commit: 4949701c880d4bdb949e3c0e6b400288da7f474b
Date: 2025-04-10T01:21:25.295Z
Electron: 34.3.2
ElectronBuildId: 11161073
Chromium: 132.0.6834.210
Node.js: 20.18.3
V8: 13.2.152.41-electron.0
OS: Windows_NT x64 10.0.26100

Its a hard error, restarting vscode doesn't help.
However, the trivial fix is to @ts-ignore as its probably just a quirk on my system

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Apr 26, 2025
@brandyscarney
Copy link
Member

Thanks for the info! I thought it might be because you were on Windows but I tested it there and still don't see the error. 😩

Could it be a caching issue with a dependency? Does it go away if you try rm -rf node_modules && npm install?

Sorry I'm at a loss of what could be causing this without being able to reproduce it.

@brandyscarney brandyscarney added the needs: reply the issue needs a response from the user label Apr 28, 2025
@ionitron-bot ionitron-bot bot removed the triage label Apr 28, 2025
@ptallettms
Copy link

Deleting node-modules and reinstalling deps made no difference I am afraid

@ionitron-bot ionitron-bot bot added triage and removed needs: reply the issue needs a response from the user labels Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants