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

can't find scripts from public directory #3

Open
Le0Developer opened this issue Jul 9, 2024 · 0 comments
Open

can't find scripts from public directory #3

Le0Developer opened this issue Jul 9, 2024 · 0 comments

Comments

@Le0Developer
Copy link

In our index.html we have:

<!doctype html>
<html lang="en" class="overscroll-none">
	<head>
		<meta charset="UTF-8" />
		<link rel="icon" type="image/jpg" href="/img/[email protected]" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="/src/index.css" />
		<script async src="/external/index.js"></script>
		<title>APP</title>
	</head>
	<body>
		<div id="root"></div>
		<script type="module" src="/src/main.tsx"></script>
	</body>
</html>

The /external/index.js file is prebundled and part of our public directory.

Error:

vite v5.3.1 building for production...
✓ 3467 modules transformed.
x Build failed in 6.47s
error during build:
[vite:build-import-analysis] Asset /external/index.js not found in bundle
    at calculateIntegrity (/home/runner/app/node_modules/vite-plugin-sri3/dist/index.js:52:35)
    at transformHTML (/home/runner/app/node_modules/vite-plugin-sri3/dist/index.js:65:49)
    at Object.generateBundle (/home/runner/app/node_modules/vite-plugin-sri3/dist/index.js:83:38)
    at async plugin.generateBundle (/home/runner/app/node_modules/vite-plugin-sri3/dist/index.js:23:13)
    at async Bundle.generate (file:///home/runner/app/node_modules/rollup/dist/es/shared/node-entry.js:18153:9)
    at async file:///home/runner/app/node_modules/rollup/dist/es/shared/node-entry.js:20692:27
    at async catchUnfinishedHookActions (file:///home/runner/app/node_modules/rollup/dist/es/shared/node-entry.js:20119:16)
    at async build (file:///home/runner/app/node_modules/vite/dist/node/chunks/dep-BcXSligG.js:65670:16)
    at async CAC.<anonymous> (file:///home/runner/app/node_modules/vite/dist/node/cli.js:828:5)

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

No branches or pull requests

1 participant