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

SyntaxError: Importing binding name 'default' cannot be resolved by star export entries. #39

Closed
glennsc opened this issue Feb 10, 2023 · 4 comments

Comments

@glennsc
Copy link

glennsc commented Feb 10, 2023

  1. I followed the configuration instructions in the docs.
  2. On running docs:dev nothing renders and and I get the following error in the browser console:
SyntaxError: Importing binding name 'default' cannot be resolved by star export entries.

My .vitepress.config.js looks like this:

/**
 * @type {import('vitepress').UserConfig}
 */

import { defineConfig } from "vitepress";
import { withMermaid } from "vitepress-plugin-mermaid";

export default withMermaid(
  defineConfig({
    lang: "en-us",
    title: "My site",
    description: "My description",
    cleanUrls: true,
    lastUpdated: true,

    themeConfig: {
      nav: [
        { text: "Docs", link: "/getting-started/overview" },
        { text: "API Reference", link: "/api-ref" },
      ],

      footer: {
        message: "Confidential. For internal use only.",
        copyright: "Copyright © 2023, Me",
      },
    },
  })
);

Package.json:

{
  "name": "my-site",
  "main": "index.js",
  "scripts": {
    "docs:dev": "vitepress dev docs",
    "docs:build": "vitepress build docs",
    "docs:preview": "vitepress preview docs"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "@mermaid-js/mermaid-mindmap": "^9.3.0",
    "mermaid": "^9.3.0",
    "vitepress": "1.0.0-alpha.45",
    "vitepress-plugin-mermaid": "^2.0.10",
    "vue": "^3.2.47"
  }
}

Anything obvious I'm doing wrong?

image

@emersonbottero
Copy link
Owner

Is not .vitepress.config.js
It should be
.vitepress/config.js

@glennsc
Copy link
Author

glennsc commented Feb 11, 2023

My apologies, that was just a typo when I wrote the issue. Yes, my file is in .vitepress/config.js

I created a minimal Vitepress install, and added the mermaid plugin per the docs, and still get the same error.

@emersonbottero
Copy link
Owner

try the solution mention here

@glennsc
Copy link
Author

glennsc commented Feb 12, 2023

Okay, yes. Dropping a vite.config.js into docs with:

export default {
  optimizeDeps: { include: ['moment-mini', '@braintree/sanitize-url'] },
}

and then

pnpm add moment-mini @braintree/sanitize-url -D

stopped the errors throwing in dev. I see mermaid merged your PR fixing this so I assume we'll be able to remove this workaround soon. Really appreciate your help, and love this plugin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants