peek.nvim: Peek error: error: Module not found `.../public/main.bundle.js`

Describe the bug I have followed the instructions provided in the repository to install the plugin.

  • Installed deno binary from the website first
  • Installed the plugin using lazy.nvim package manager
  • The build part of the command deno task --quiet build:fast fails with an error:
error: Node specifiers have not yet been implemented for this subcommand (https://github.com/denoland/deno/issues/15960). Found: node:punycode

Steps To Reproduce

  1. Open NeoVim instance and a markdown file
  2. Execute :lua require('peek').open() command, which throws an error:
Peek error: error: Module not found "file:///home/kenja/.local/share/nvim/lazy/peek.nvim/public/main.bundle.js".

Expected behavior A markdown preview should open when :lua require('peek').open() is executed

Desktop (please complete the following information):

  • OS: Ubuntu
  • nvim --version:
NVIM v0.10.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
  • deno --version:
deno 1.34.2 (release, x86_64-unknown-linux-gnu)
v8 11.5.150.2
typescript 5.0.4
  • plugin setup:
require('peek').setup()

Additional context Similar issues were noted in #11, #28 and #46 Workarounds (manual installation) provided in these issues failed with the same error above error: Node specifiers ...

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 23
  • Comments: 15

Most upvoted comments

I had the same problem and implemented the four lines from the PR @pabloqpacin recommended. Ran a fresh deno task --quiet build and peek is now working as expected.

Can confirm the tweaks at #50 fix the issue ๐Ÿ‘

facing the same problem when Iโ€™m trying out this tool, in the meantime, I think u guys can try this markdown preview tool

I replaced the bundling process with deno_emit. This works nice.

I will replace all other bundlings with this also and open a PR. In the meantime you can try my version here: https://github.com/cloudsftp/peek.nvim/tree/bundle

Facing the same problem.

:PeekOpen returns:

Peek error: error: Module not found โ€œfile:///home/pabloqpacin/.local/share/nvim/site/pack/packer/s tart/peek.nvim/public/main.bundle.jsโ€."

Now this is the output for cd ~/.local/share/nvim/site/pack/packer/start/peek.nvim && deno task build:debug:

peek.nvim (master) ยป deno task build:debug ~/.local/share/nvim/site/pack/packer/start/peek.nvim
Task build:debug DEBUG=true deno task build
Task build deno run --allow-run --allow-net --allow-read --allow-write --allow-env --no-check scripts/build.js
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ (idx)                   โ”‚ size   โ”‚ modified                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ style.css               โ”‚   3344 โ”‚ "11/08/2023, 15:44:43.084" โ”‚
โ”‚ index.html              โ”‚    691 โ”‚ "11/08/2023, 15:44:43.084" โ”‚
โ”‚ webview.js              โ”‚ 291446 โ”‚ "11/08/2023, 15:44:43.220" โ”‚
โ”‚ github-markdown.min.css โ”‚  20677 โ”‚ "11/08/2023, 15:44:43.540" โ”‚
โ”‚ script.bundle.js        โ”‚  15840 โ”‚ "11/08/2023, 15:44:43.168" โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/master
Warning "deno bundle" is deprecated and will be removed in the future.
Use alternative bundlers like "deno_emit", "esbuild" or "rollup" instead.
Warning "deno bundle" is deprecated and will be removed in the future.
Use alternative bundlers like "deno_emit", "esbuild" or "rollup" instead.
Warning "deno bundle" is deprecated and will be removed in the future.
Use alternative bundlers like "deno_emit", "esbuild" or "rollup" instead.
Download https://cdn.skypack.dev/-/@types/mermaid@v9.2.0-pzeUsl8991wW0ORkKqNC/dist=es2019,mode=typ
Bundle file:///home/pabloqpacin/.local/share/nvim/site/pack/packer/start/peek.nvim/app/src/webview.ts
error: Node specifiers have not yet been implemented for this subcommand (https://github.com/denoland/deno/issues/15960). Found: node:punycode
Bundle file:///home/pabloqpacin/.local/share/nvim/site/pack/packer/start/peek.nvim/client/src/script.ts
Emit "public/script.bundle.js" (15.47KB)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚ (idx)                   โ”‚ size   โ”‚ modified                   โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚ style.css               โ”‚   3344 โ”‚ "11/08/2023, 15:44:43.084" โ”‚
โ”‚ index.html              โ”‚    691 โ”‚ "11/08/2023, 15:44:43.084" โ”‚
โ”‚ webview.js              โ”‚ 291446 โ”‚ "11/08/2023, 15:47:02.870" โ”‚
โ”‚ github-markdown.min.css โ”‚  20677 โ”‚ "11/08/2023, 15:44:43.540" โ”‚
โ”‚ script.bundle.js        โ”‚  15840 โ”‚ "11/08/2023, 15:47:03.478" โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Notably, no peek.nvim/public/main.bundle.js file is created or available. A few months ago I got this up and running in both WSL_Ubuntu and Arch and loved it. Now however Iโ€™m running Pop!_OS and there seems to be no solution but either OS.

same problem, env as follow

โฑโฑโฑ nvim --version
NVIM v0.9.1
Build type: Release
LuaJIT 2.1.0-beta3

     ็ณป็ปŸ vimrc ๆ–‡ไปถ: "$VIM/sysinit.vim"
         $VIM ้ข„่ฎพๅ€ผ: "/opt/homebrew/Cellar/neovim/0.9.1/share/nvim"

Run :checkhealth for more info
โฑโฑโฑ deno --version
deno 1.34.3 (release, aarch64-apple-darwin)
v8 11.5.150.2
typescript 5.0.4