Azure-Samples / Azure-Samples/azure-sql-db-session-recommender-v2

Rollup failed to resolve import "/src/main.tsx" from "/workspaces/codespaces-blank/client/index.html".

Open
#9 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Bicep
Stars
46
Forks
28
PR merge metrics
No merged PRs in 30d

Description

> Please provide us with the following information:
> ---------------------------------------------------------------

### This issue is for a: (mark with an `x`)
```
- [X ] bug report -> please search issues before submitting
- [ ] feature request
- [ ] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)
```

### Minimal steps to reproduce
>
go to https://github.com/codespaces
https://github.com/github/codespaces-blank
Start with a blank canvas
in a blank codespaces from the terminal
install azd
curl -fsSL https://aka.ms/install-azd.sh | bash
azd auth login
Initialize the template
Then, execute the azd init command to initialize the environment (You do not need to run this command if you already have the code or have opened this in a Codespace or DevContainer).

azd init -t Azure-Samples/azure-sql-db-session-recommender-v2
Enter an environment name.

Deploy the sample
Run azd up to provision all the resources to Azure and deploy the code to those resources.

azd up

### Any log messages given by the failure
>
Packaging services (azd package)

(✓) Done: Packaging service functionapp
- Package Output: /tmp/azure-sql-db-session-recommender-v2-functionapp-azddeploy-1727281660.zip

(x) Failed: Packaging service web

ERROR: error executing step command 'package --all': failed packaging service 'web': failed to run NPM script build, exit code: 1, stdout:
> client@0.0.0 build
> vite build

vite v4.4.11 building for production...
transforming...
✓ 2 modules transformed.
✓ built in 52ms
, stderr: [vite]: Rollup failed to resolve import "/src/main.tsx" from "/workspaces/codespaces-blank/client/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
error during build:
Error: [vite]: Rollup failed to resolve import "/src/main.tsx" from "/workspaces/codespaces-blank/client/index.html".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`
at viteWarn (file:///workspaces/codespaces-blank/client/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:48205:27)
at onwarn (file:///workspaces/codespaces-blank/client/node_modules/@vitejs/plugin-react/dist/index.mjs:247:9)
at onRollupWarning (file:///workspaces/codespaces-blank/client/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:48234:9)
at onwarn (file:///workspaces/codespaces-blank/client/node_modules/vite/dist/node/chunks/dep-2b82a1ce.js:47965:13)
at file:///workspaces/codespaces-blank/client/node_modules/rollup/dist/es/shared/node-entry.js:24276:13
at Object.logger [as onLog] (file:///workspaces/codespaces-blank/client/node_modules/rollup/dist/es/shared/node-entry.js:25950:9)
at ModuleLoader.handleInvalidResolvedId (file:///workspaces/codespaces-blank/client/node_modules/rollup/dist/es/shared/node-entry.js:24862:26)
at file:///workspaces/codespaces-blank/client/node_modules/rollup/dist/es/shared/node-entry.js:24822:26

### Expected/desired behavior
>

### OS and Version?
> Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?)

### Versions
>

### Mention any other details that might be useful

> ---------------------------------------------------------------
> Thanks! We'll be in touch soon.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.