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

Documents named arguments.md cannot be built. #1068

Closed
3 tasks done
lurr opened this issue Jul 26, 2022 · 1 comment
Closed
3 tasks done

Documents named arguments.md cannot be built. #1068

lurr opened this issue Jul 26, 2022 · 1 comment
Labels
bug Something isn't working build Related to the build system

Comments

@lurr
Copy link

lurr commented Jul 26, 2022

Describe the bug

Attempting to run vitepress build docs when there exists a file docs/**/arguments.md results in a crash.

$ yarn vitepress build docs
yarn run v1.22.19
$ /home/.../website/node_modules/.bin/vitepress build docs
vitepress v1.0.0-alpha.4
⠇ building client + server bundles...[vite:esbuild-transpile] Transform failed with 1 error:
arguments.md.js:21:4: ERROR: Declarations with the name "arguments" cannot be used in strict mode

Declarations with the name "arguments" cannot be used in strict mode
19 |    return _sfc_setup ? _sfc_setup(props, ctx) : undefined
20 |  };
21 |  var arguments = /*#__PURE__*/pluginVue_exportHelper._export_sfc(_sfc_main, [['ssrRender',_sfc_ssrRender]]);
   |      ^
22 |  
23 |  exports.__pageData = __pageData;

✖ building client + server bundles...
[vite:esbuild-transpile] Transform failed with 1 error:
assets/arguments.md.88297d47.js:14:4: ERROR: Declarations with the name "arguments" cannot be used in an ECMAScript module

Declarations with the name "arguments" cannot be used in an ECMAScript module
12 |    return (openBlock(), createElementBlock("div", null, _hoisted_2))
13 |  }
14 |  var arguments = /*#__PURE__*/_export_sfc(_sfc_main, [['render',_sfc_render]]);
   |      ^
15 |  
16 |  export { __pageData, arguments as default };

build error:
 Error: Transform failed with 1 error:
arguments.md.js:21:4: ERROR: Declarations with the name "arguments" cannot be used in strict mode
    at failureErrorWithLog (/home/.../website/node_modules/esbuild/lib/main.js:1615:15)
    at /home/.../website/node_modules/esbuild/lib/main.js:1404:29
    at /home/.../website/node_modules/esbuild/lib/main.js:669:9
    at handleIncomingPacket (/home/.../website/node_modules/esbuild/lib/main.js:766:9)
    at Socket.readFromStdout (/home/.../website/node_modules/esbuild/lib/main.js:635:7)
    at Socket.emit (node:events:527:28)
    at addChunk (node:internal/streams/readable:315:12)
    at readableAddChunk (node:internal/streams/readable:289:9)
    at Socket.Readable.push (node:internal/streams/readable:228:10)
    at Pipe.onStreamRead (node:internal/stream_base_commons:190:23) {
  errors: [
    {
      detail: undefined,
      id: '',
      location: [Object],
      notes: [Array],
      pluginName: '',
      text: 'Declarations with the name "arguments" cannot be used in strict mode'
    }
  ],
  warnings: [],
  frame: '\n' +
    '\x1B[33mDeclarations with the name "arguments" cannot be used in strict mode\x1B[39m\n' +
    '19 |    return _sfc_setup ? _sfc_setup(props, ctx) : undefined\n' +
    '20 |  };\n' +
    "21 |  var arguments = /*#__PURE__*/pluginVue_exportHelper._export_sfc(_sfc_main, [['ssrRender',_sfc_ssrRender]]);\n" +
    '   |      ^\n' +
    '22 |  \n' +
    '23 |  exports.__pageData = __pageData;\n',
  loc: {
    column: 4,
    file: 'arguments.md.js',
    length: 9,
    line: 21,
    lineText: "var arguments = /*#__PURE__*/pluginVue_exportHelper._export_sfc(_sfc_main, [['ssrRender',_sfc_ssrRender]]);",
    namespace: '',
    suggestion: ''
  },
  code: 'PLUGIN_ERROR',
  plugin: 'vite:esbuild-transpile',
  hook: 'renderChunk'
}

Reproduction

To reproduce, create a file called arguments.md with any content inside the vitepress docs folder (or other target).
Then, run vitepress build <folder>, and the error will occur.

Expected behavior

The expected behaviour is to generate an arguments.html file.

System Info

System:
    OS: Linux 5.18 Arch Linux
    CPU: (12) x64 AMD Ryzen 5 2600X Six-Core Processor
    Memory: 18.11 GB / 31.28 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 16.16.0 - /usr/bin/node
    Yarn: 1.22.19 - /usr/bin/yarn
    npm: 8.14.0 - /usr/bin/npm
  Browsers:
    Chromium: 103.0.5060.134
  npmPackages:
    vitepress: ^1.0.0-alpha.4 => 1.0.0-alpha.4 

Additional context

No response

Validations

  • Follow our Code of Conduct
  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
@lurr lurr added the bug: pending triage Maybe a bug, waiting for confirmation label Jul 26, 2022
@brc-dd brc-dd added bug Something isn't working build Related to the build system and removed bug: pending triage Maybe a bug, waiting for confirmation labels Jul 26, 2022
@yyx990803
Copy link
Member

This is a bug in Rollup: rollup/rollup#4612

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

No branches or pull requests

3 participants