aklinker1 / vite-plugin-web-extension

Vite plugin for developing Chrome/Web Extensions
https://vite-plugin-web-extension.aklinker1.io/
MIT License
654 stars 57 forks source link

No console logs to be found in chrome running npm run dev #191

Closed thebspin closed 4 months ago

thebspin commented 6 months ago

Summary

I expect there to be console.logs visible in the console in terminal that is being spawned after running npm run dev. First i thought this might been a issue with the svelte-ts template but the vue-ts does not seem to work either.

Reproduction

npm create vite-plugin-web-extension And choose svelte-ts or vue-ts (have not tried the others)

Environment

  System:
    OS: macOS 14.4.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 314.72 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.9.0 - ~/Library/Caches/fnm_multishells/5827_1715270057097/bin/node
    npm: 10.1.0 - ~/Library/Caches/fnm_multishells/5827_1715270057097/bin/npm
    pnpm: 8.15.4 - /opt/homebrew/bin/pnpm
    bun: 1.0.30 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 124.0.6367.119
    Safari: 17.4.1
  npmPackages:
    vite: ^5.0.0 => 5.2.11
    vite-plugin-web-extension: ^4.0.0 => 4.1.3
aklinker1 commented 6 months ago

Runtime logs show up in the browser's devtools, not the terminal used to run vite. That terminal only shows build logs/errors.

This is the standard for web development.

thebspin commented 6 months ago

I'm sorry for the confusion. But they dont show in the console devtools where the plugin is running in. The chrome devtools that is being spawned after running npm run dev

42willow commented 5 months ago

I don't really understand what you mean.... console logs work fine for me. If you go to the popup page's console you should see Hello from the popup! and if you go to the service worker/background script's console you should see Hello from the background! image

popup right click inspect

thebspin commented 5 months ago

popup right click inspect

Thanks it actually never occured to me to right click the popup.. in my head it made sense the console log would just log whatever the popup was logging

kepi commented 4 months ago

@aklinker1 IMHO this can be closed