-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
esbuild littered with sideEffect warnings #6291
Comments
The stackblitz link is using a minimal build. Run
This happens I believe on any adapter that is outputting a bundle with esbuild. The
|
Hi. Since I'm using SSR with netlify, I'm getting the following message when I run the server:
And my Astro: 2.0.14 UpdateFalse Alarm. I think my issue is fixed with |
Funny, I was importing via glob for our project and came across that issue as well. But starting with a public Astro template and keeping it stock, you still get the warnings so something needs to be fixed. |
@ematipico Is there anything we can do to silence these warnings? |
@matthewp Unfortunately ended up deciding to switch to Next.js due to the uncertainty of deploying a potential broken build. It shouldn't be a hard change to go back to Astro world, but seeing so many build errors in CI made us feel we can potentially do something that will actually break. |
I'm getting the same error with Astro 2.1.2 and the Cloudflare Adapter. I tried removing the adapter and switching to a static build. |
@jdbruxelles How did you set the eager flag in your Astro config? |
Hi @jackcarey. I have set the eager property like this: // In my src/pages/all-data.json.ts file (not astro.config.mjs)
const allAAAA = import.meta.glob("/public/data/AAAA/*.json", { eager: true });
const allBBBB = import.meta.glob("/public/data/BBBB/*.json", { eager: true });
const allData = [];
// Doing something with the data
export async function get({params, request}) {
return {
body: JSON.stringify(allData)
};
} See the documentation of Vite Glob Import for more information. |
These warnings are caused by double-building. We build with Vite which does not remove imports for packages with |
I see similar warnings using Vercel adapter with edge functions (serverless is ok). Should I try to make a repro or separate issue? |
@susickypavel This is closed, create new issue. |
im having the same issue with vercel edge adapter |
I managed to remove the warning by adding: export default defineConfig({
...
vite: {
ssr: {
noExternal: ['path-to-regexp'],
},
},
...
}) to my |
What version of
astro
are you using?2.0.14
Are you using an SSR adapter? If so, which one?
Cloudflare / Vercel Edge
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
~/code/dreary-dwarf ❯ npm run build 01:34:51 PM
01:34:55 PM [content] Types generated 193ms
01:34:55 PM [build] output target: server
01:34:55 PM [build] deploy adapter: @astrojs/cloudflare
01:34:55 PM [build] Collecting build info...
01:34:55 PM [build] Completed in 445ms.
01:34:55 PM [build] Building server entrypoints...
01:34:55 PM [build] Completed in 0.83s.
finalizing server assets
01:34:55 PM [build] Rearranging server assets...
@astrojs/sitemap: Skipped!
No pages found! We can only detect sitemap routes for "static" builds. Since you are using an SSR adapter, we recommend manually listing your sitemap routes using the "customPages" integration option.
Example:
sitemap({ customPages: ['https://example.com/route'] })
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
▲ [WARNING] Ignoring this import because "node_modules/path-to-regexp/dist.es2015/index.js" was marked as having no side effects [ignored-bare-import]
"sideEffects" is false in the enclosing "package.json" file
01:34:56 PM [build] Server built in 1.39s
01:34:56 PM [build] Complete!
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-kqoejc?file=astro.config.mjs
Participation
The text was updated successfully, but these errors were encountered: