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

Using createContentLoader in xxx.data.mts causes an error #3051

Closed
4 tasks done
wangxiaocuo opened this issue Oct 7, 2023 · 4 comments · Fixed by #3058
Closed
4 tasks done

Using createContentLoader in xxx.data.mts causes an error #3051

wangxiaocuo opened this issue Oct 7, 2023 · 4 comments · Fixed by #3058
Labels
bug Something isn't working

Comments

@wangxiaocuo
Copy link

Describe the bug

When I refer to official documents and Vue Blog to expand the default theme, an error occurred.

When I use createContentLoader in xxx.data.mts, the console will output a syntax error.

Reproduction

It can be reproduced in the following Repository: xiaocuo.wang.

Expected behavior

Expect normal operation without errors.

System Info

System:
  OS: macOS 13.5.2
  CPU: (8) arm64 Apple M1
  Memory: 95.55 MB / 16.00 GB
  Shell: 5.9 - /bin/zsh
Binaries:
  Node: 16.17.1 - ~/.nvm/versions/node/v16.17.1/bin/node
  Yarn: 1.22.19 - ~/.nvm/versions/node/v16.17.1/bin/yarn
  npm: 8.15.0 - ~/.nvm/versions/node/v16.17.1/bin/npm
  pnpm: 8.7.5 - ~/.nvm/versions/node/v16.17.1/bin/pnpm
Browsers:
  Chrome: 117.0.5938.149
  Safari: 16.6
npmPackages:
  vitepress: ^1.0.0-rc.20 => 1.0.0-rc.20

Additional context

image

Validations

@wangxiaocuo wangxiaocuo added the bug: pending triage Maybe a bug, waiting for confirmation label Oct 7, 2023
@Fancy11111
Copy link

Hi, I currently face the same issue, did you solve this? @wangxiaocuo

@wangxiaocuo
Copy link
Author

Nope😭 @Fancy11111

@brc-dd brc-dd added bug Something isn't working and removed bug: pending triage Maybe a bug, waiting for confirmation labels Oct 9, 2023
@brc-dd
Copy link
Member

brc-dd commented Oct 9, 2023

Use .js or .ts for now. You'll need to put "type": "module" in your nearest package.json. Will be fixed in next version.

@wangxiaocuo
Copy link
Author

It worked. Thank you. @brc-dd

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants