question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot resolve console [Building for Cloudflare Workers]

See original GitHub issue

Following the Cloudflare Workers example, upon running build:worker, I get this error:

👀  ./node_modules/vite-plugin-ssr/dist/cjs/html/inferMediaType.js
Module not found: Error: Can't resolve 'console' in '/Users/hrgui/projects/pokedex-vite-ssr/node_modules/vite-plugin-ssr/dist/cjs/html'

Here’s a test repo: https://github.com/hrgui/pokedex-vite-plugin-ssr

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:18 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
brilloutcommented, Aug 9, 2021

Fix released in 0.2.6.

Thanks @frandiox @marshallswain.

0reactions
brilloutcommented, Aug 10, 2021

@hrgui Nice digging 👌

Read more comments on GitHub >

github_iconTop Results From Across the Web

A few issues with workers (when creating a worker)
Ok, I have noticed several problems with Cloudflare workers (most if not all of these when creating a worker).
Read more >
Get started guide · Cloudflare Workers docs
Get started guide. This guide will instruct you through setting up a Cloudflare account to deploying your first Worker.
Read more >
Custom TS build - I don't want webpack - Workers
I want to use a custom build for my TypeScript project. ... On Workers, you cannot use function generators (which dynamic import requires) ......
Read more >
Node module in wrangler cannot be resolved - Workers
If I try to use http-errors is get back on building ✘ [ERROR] Could not resolve "http-errors" src/index.ts:11:54: 11 │ import {BadRequest, ...
Read more >
Using Durable Objects · Cloudflare Workers docs
This ensures that the state of the Object cannot unexpectedly change while a read operation is in-flight, which would otherwise make it very ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found