Thanks to visit codestin.com
Credit goes to github.com

Skip to content

failing while using vite (rollup) #93

@emersonbottero

Description

@emersonbottero

Describe the bug
I'm trying to build a library that uses this incllusive-dates

getting this error

PS C:\Users\emers\Source\Repos\histoire-demo> npm run story:dev

[email protected] story:dev
histoire dev

Failed to resolve dependency: vscode-oniguruma, present in 'optimizeDeps.include'
Failed to resolve dependency: vscode-textmate, present in 'optimizeDeps.include'
Using 4 threads for story collection
Collect stories start all
➜ Local: http://127.0.0.1:6006/
➜ Network: use --host to expose
12:35:56 AM [vite] Failed to load source map for /node_modules/inclusive-dates/dist/themes/light.css.
(node:19672) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use node --trace-warnings ... to show where the warning was created)
Error while collecting story C:/Users/emers/Source/Repos/histoire-demo/docs/SButton.story.vue:
C:\Users\emers\Source\Repos\histoire-demo\node_modules\inclusive-dates\dist\components\inclusive-dates.js:1
import { proxyCustomElement, HTMLElement, createEvent, h, Host } from '@stencil/core/internal/client';
^^^^^^

SyntaxError: Cannot use import statement outside a module
at Object.compileFunction (node:vm:360:18)
at wrapSafe (node:internal/modules/cjs/loader:1084:15)
at Module._compile (node:internal/modules/cjs/loader:1119:27)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1209:10)
at Module.load (node:internal/modules/cjs/loader:1033:32)
at Function.Module._load (node:internal/modules/cjs/loader:868:12)
at ModuleWrap. (node:internal/modules/esm/translators:169:29)
at ModuleJob.run (node:internal/modules/esm/module_job:193:25)
at async Promise.all (index 0)
at async ESMLoader.import (node:internal/modules/esm/loader:526:24)

Reproduction
Steps to reproduce the behavior:

  1. git clone https://github.com/emersonbottero/histoire-demo.git
  2. npm i
  3. npm run story:dev
  4. See error

Expected behavior
it should build and show the component rendered in histoire

Screenshots
If applicable, add screenshots to help explain your problem.

System:
OS: Windows 10 10.0.22621
CPU: (8) x64 Intel(R) Core(TM) i7-6700HQ CPU @ 2.60GHz
Memory: 5.89 GB / 15.92 GB
Binaries:
Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.5 - ~\AppData\Roaming\npm\yarn.CMD
npm: 8.1.3 - ~\AppData\Roaming\npm\npm.CMD
Browsers:
Chrome: 114.0.5735.134
Edge: Spartan (44.22621.1830.0), Chromium (114.0.1823.51)
Internet Explorer: 11.0.22621.1
npmPackages:
@histoire/plugin-vue: ^0.16.1 => 0.16.1
@vitejs/plugin-vue: ^4.2.3 => 4.2.3
histoire: ^0.16.2 => 0.16.2
vite: ^4.3.9 => 4.3.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions