Cloudflare with esbuild broken with v0.3.56
See original GitHub issueHi,
Since the latest version I get the following warning when trying to build with esbuild
:
▲ [WARNING] Import “createPageRenderer” will always be undefined because the file “…/…/node_modules/vite-plugin-ssr/dist/esm/client/node.js” has no exports
worker/index.ts:1:9: 1 │ import { createPageRenderer } from 'vite-plugin-ssr' ╵ ~~~~~~~~~~~~~~~~~~
When I ignore this warning, miniflare
throws this error at me:
MiniflareCoreError [ERR_MOUNT]: Error mounting “project” […] { code: ‘ERR_MOUNT’, cause: Error: [vite-plugin-ssr@0.3.56][Wrong Usage] The module
vite-plugin-ssr
cannot be imported in the browser. Did you mean to import the modulevite-plugin-ssr/client
instead? at …/…/node_modules/vite-plugin-ssr/dist/esm/client/node.js (/…/dist/worker.js:197:5) at __init (/…dist/worker.js:9:56) at /…/dist/worker.js:47083:1
My `build.js` file which builds the worker
import esbuild from 'esbuild'
import { NodeModulesPolyfillPlugin } from '@esbuild-plugins/node-modules-polyfill'
esbuild
.build({
external: ['__STATIC_CONTENT_MANIFEST'],
entryPoints: ['./worker/index.ts'],
sourcemap: false,
outfile: './dist/worker.js',
logLevel: 'info',
platform: 'browser',
plugins: [NodeModulesPolyfillPlugin()],
format: 'esm',
target: 'es2020',
bundle: true,
})
.then(() => console.log(`Successfully built worker.`))
Issue Analytics
- State:
- Created 2 years ago
- Comments:9 (9 by maintainers)
Top Results From Across the Web
Error when deploying a website on Cloudflare Pages
Error arises during build stage on Cloudflare Pages. The website I am trying to deploy is made using astro-build.
Read more >res.dcsr.txt - Debian
... filetea 0.1.18-1 OK [REASONS_NOT_COMPUTED] filezilla 3.56.0-1 OK ... golang-github-cloudflare-cfssl 1.2.0+git20160825.89.7fb22c8-3.1 OK ...
Read more >vite-plugin-ssr - bytemeta
Cloudflare with esbuild broken with v0.3.56. frog-o. frog-o OPEN · Updated 7 months ago · Add docs about page keeping auto refreshing. kamui....
Read more >Nuxt.js 3 x Histoire x Vitest x VitePress x Turbo (pnpm)
chore(deps): update dependency vitest to v0.24.3 ... (3.56 kB) (599 B gzip) @myturborepo/web:build: Σ Total size: 5.93 MB (1.51 MB gzip) ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try this:
From https://github.com/evanw/esbuild/issues/1189.
@brillout Great suggestion! I’ve just opened a PR for this