toppair / peek.nvim

Markdown preview plugin for Neovim
MIT License
589 stars 37 forks source link

Peek error: error: Module not found "file:///home/tornax/.local/share/nvim/lazy/peek.nvim/public/main.bundle.js". #28

Closed TornaxO7 closed 1 year ago

TornaxO7 commented 1 year ago

Describe the bug I'm getting the following error message if I excute :lua require('peek').open().

To Reproduce I'm using lazy as my plugin manager. This is in my ~/.config/nvim/lua/plugins/peek_settings/init.lua

```lua return { "toppair/peek.nvim", ft = "markdown", build = "deno task --quiet build:fast", init = function() require("peek").setup({ auto_load = false, close_on_bdelete = true, syntax = false, theme = "dark", update_on_change = true, app = {'google-stable-chrome', '--new-window'}, filetype = {"markdown"}, throttle_at = 200000, throttle_time = "auto", }) require("plugins.peek_settings.commands") end, } ```

~/.config/nvim/lua/plugins/peek_settings/commands.lua

```lua vim.api.nvim_create_user_command('PeekOpen', require('peek').open, {}) vim.api.nvim_create_user_command('PeekClose', require('peek').close, {}) ```

Steps:

  1. Do nvim /tmp/test.md
  2. Execute :PeekOpen or lua require("peek").open().

Expected behavior That everything works fine.

Screenshots image

This pops up.

Desktop (please complete the following information):

``` NVIM v0.9.0-dev-854+g9ce44a750c Build type: RelWithDebInfo LuaJIT 2.1.0-beta3 Compilation: /usr/bin/cc -march=x86-64 -mtune=generic -O2 -pipe -fno-plt -fexceptions -Wp,-D_FORTIFY_SOURCE=2 -Wformat -Werror=format-security -fstack-clash-protection -fcf-protection -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=1 -O2 -g -Og -g -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wdouble-promotion -Wmissing-noreturn -Wmissing-format-attribute -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fno-common -fdiagnostics-color=always -fstack-protector-strong -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_TS_HAS_SET_MATCH_LIMIT -DNVIM_TS_HAS_SET_ALLOCATOR -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DMIN_LOG_LEVEL=3 -I/usr/include/luajit-2.1 -I/usr/include -I/home/tornax/.cache/paru/clone/neovim-git/src/build/src/nvim/auto -I/home/tornax/.cache/paru/clone/neovim-git/src/build/include -I/home/tornax/.cache/paru/clone/neovim-git/src/build/cmake.config -I/home/tornax/.cache/paru/clone/neovim-git/src/neovim/src Compiled by tornax Features: +acl +tui See ":help feature-compile" system vimrc file: "$VIM/sysinit.vim" fall-back for $VIM: "/usr/share/nvim" Run :checkhealth for more info ```
``` deno 1.31.1 (release, x86_64-unknown-linux-gnu) v8 11.0.226.13 typescript 4.9.4 ```
1amSimp1e commented 1 year ago

I got the same error and fixed by installing webkit2gtk packages on aur. Try it and let me know if it works

mark-ruddy commented 1 year ago

Installing the webkit2gtk packages didn't help me in this case. I'm also using lazy package manager which must be the problem, peek's scripts/build.js file is not getting executed so the generated files don't exist.

Workaround is:

cd ~/.local/share/nvim/lazy/peek.nvim
deno run --allow-run --allow-net --allow-read --allow-write --allow-env --no-check scripts/build.js
1amSimp1e commented 1 year ago

hmmm... Reinstall lazy packages then try again

razzat008 commented 1 year ago

This fixed my issue.

deno run --allow-run --allow-net --allow-read --allow-write --allow-env --no-check scripts/build.js

PS: for anyone using packer you'll need to go to

~/.local/share/nvim/site/pack/packer/start/peek.nvim

to run to above command

5iddy commented 1 year ago

I got a similar error on windows too. The issue was Neovim was installed and the plugin was setup before deno was installed on my PC.

So I ran :Lazy build peek.nvim, it seemed to fix this issue.

TornaxO7 commented 1 year ago

I got a similar error on windows too. The issue was Neovim was installed and the plugin was setup before deno was installed on my PC.

So I ran :Lazy build peek.nvim, it seemed to fix this issue.

Wohoo! That did it!

TornaxO7 commented 1 year ago

@1amSimp1e should I close this issue?

1amSimp1e commented 1 year ago

yeh close it