Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@lwrjs/markdown-view-provider: The requested module 'unist-util-visit' does not provide an export named 'default' #7

Open
zerkz opened this issue Apr 16, 2024 · 1 comment
Labels
salesforce issue Issue not directly related to LWC Garden

Comments

@zerkz
Copy link

zerkz commented Apr 16, 2024

OS: OS X Sonoma
Machine : M2 macbook pro

Using nvm, specifically node 18.17.1.

Here's basically what I did:

nvm use --lts
npm install -g pnpm
git clone https://github.com/lukethacoder/lwc-garden
cd lwc-garden
pnpm install 
pnpm run examples:minimal-config

result:

❯ pnpm run examples:minimal-config

> [email protected] examples:minimal-config /Users/zdware/test_lwc_garden/lwc_garden/lwc-garden
> pnpm --filter=@lwc-garden/example-minimal-config dev

examples/disable-lwc-synthetic-shadow    |  WARN  The field "pnpm" was found in /Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/examples/disable-lwc-synthetic-shadow/package.json. This will not take effect. You should configure "pnpm" at the root of the workspace instead.

> @lwc-garden/[email protected] dev /Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/examples/minimal-config
> npx @lwc-garden/core dev

[config] peer dependency pwa-kit-runtime was not provided
(node:19787) ExperimentalWarning: Import assertions are not a stable feature of the JavaScript language. Avoid relying on their current behavior and syntax as those might change in a future version of Node.js.
(Use `node --trace-warnings ...` to show where the warning was created)
(node:19787) ExperimentalWarning: Importing JSON modules is an experimental feature and might change at any time
[error] The requested module 'unist-util-visit' does not provide an export named 'default'
file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]/node_modules/@lwrjs/markdown-view-provider/build/es/markdown-parser/plugins/highlighter.js:3
import visit from 'unist-util-visit';
       ^^^^^
SyntaxError: The requested module 'unist-util-visit' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@lwrjs/config/build/es/modules.js:22
        throw new Error(`Unable to load configurable module: ${filepath}`);
              ^

Error: Unable to load configurable module: @lwrjs/markdown-view-provider
    at importModule (file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@lwrjs/config/build/es/modules.js:22:15)
    at async file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@lwrjs/config/build/es/modules.js:27:22
    at async Promise.all (index 2)
    at async loadServices (file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected][email protected]/node_modules/@lwrjs/config/build/es/modules.js:66:27)
    at async initContext (file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_@lwc+feature_qoiabfklmdermkrbhjie3vnuei/node_modules/@lwrjs/core/build/es/index.js:53:22)
    at async LwrApp.init (file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_@lwc+feature_qoiabfklmdermkrbhjie3vnuei/node_modules/@lwrjs/core/build/es/index.js:121:29)
    at async LwrApp.listen (file:///Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/node_modules/.pnpm/@[email protected]_@[email protected]_@[email protected]_@[email protected]_@lwc+feature_qoiabfklmdermkrbhjie3vnuei/node_modules/@lwrjs/core/build/es/index.js:134:9)

Node.js v18.17.1
/Users/zdware/test_lwc_garden/lwc_garden/lwc-garden/examples/minimal-config:
 ERR_PNPM_RECURSIVE_RUN_FIRST_FAIL  @lwc-garden/[email protected] dev: `npx @lwc-garden/core dev`
Exit status 1
 ELIFECYCLE  Command failed with exit code 1.
 
@lukethacoder
Copy link
Owner

ah yes, this infamous issue. Not too sure why I run into this, sometimes its fine, othertimes it causes issues.

Simple enough fix is to open the source files for the @lwrjs/markdown-view-provider package and change all references of import visit from 'unist-util-visit' to instead be import { visit } from 'unist-util-visit'.

A shame the @lwrjs/* packages are all closed source and don't have a nice place to raise these sorts of issues.

@lukethacoder lukethacoder added the salesforce issue Issue not directly related to LWC Garden label Apr 16, 2024
@lukethacoder lukethacoder changed the title examples fail to run/start on Node LTS (hydrogen) @lwrjs/markdown-view-provider: The requested module 'unist-util-visit' does not provide an export named 'default' Apr 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
salesforce issue Issue not directly related to LWC Garden
Projects
None yet
Development

No branches or pull requests

2 participants