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

Update recommended workaround for inlining a package #6237

Closed
6 tasks done
IAmLuisJ opened this issue Jul 29, 2024 · 0 comments · Fixed by IAmLuisJ/vitest#1 or IAmLuisJ/vitest#2 · May be fixed by #6238
Closed
6 tasks done

Update recommended workaround for inlining a package #6237

IAmLuisJ opened this issue Jul 29, 2024 · 0 comments · Fixed by IAmLuisJ/vitest#1 or IAmLuisJ/vitest#2 · May be fixed by #6238

Comments

@IAmLuisJ
Copy link

Describe the bug

When Vitest runs into SyntaxError: Cannot use import statement outside a module it recommends the following workaround

`As a temporary workaround you can try to inline the package by updating your config:

// vitest.config.js
export default {
  test: {
    server: {
      deps: {
        inline: [
          "react-native"
        ]
      }
    }
  }
}
`

server.deps.inline is deprecated and the suggestion should be updated to

`As a temporary workaround you can try to inline the package by updating your config:

// vitest.config.js
export default {
  test: {
    deps: {
      optimizer: {
        web: {
          include: [ "react-native"],
          enabled: true,
        },
      },
    },
}
`

Reproduction

Any project that requires deeply nested alias configs in dependencies

System Info

System:
    OS: macOS 14.5
    CPU: (8) arm64 Apple M2
    Memory: 316.92 MB / 16.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 18.20.3 - ~/.nvm/versions/node/v18.20.3/bin/node
    npm: 10.7.0 - ~/.nvm/versions/node/v18.20.3/bin/npm
  Browsers:
    Chrome: 126.0.6478.185
    Edge: 127.0.2651.74
    Safari: 17.5
  npmPackages:
    @vitejs/plugin-react: 4.2.1 => 4.2.1 
    @vitest/coverage-v8: ^2.0.3 => 2.0.4 
    @vitest/ui: ^2.0.2 => 2.0.4 
    vite: 5.2.6 => 5.2.6 
    vitest: ^2.0.2 => 2.0.4

Used Package Manager

npm

Validations

IAmLuisJ added a commit to IAmLuisJ/vitest that referenced this issue Jul 29, 2024
Update recommended workaround for inlining a package that has a syntax error when resolving a bundled dependency, since the current workaround uses deprecated config options

close vitest-dev#6237
IAmLuisJ added a commit to IAmLuisJ/vitest that referenced this issue Jul 29, 2024
Update recommended workaround for inlining a package that has a syntax error when resolving a bundled dependency, since the current workaround uses deprecated config options

close vitest-dev#6237
IAmLuisJ added a commit to IAmLuisJ/vitest that referenced this issue Jul 29, 2024
Update recommended workaround for inlining a package that has a syntax error when resolving a bundled dependency, since the current workaround uses deprecated config options

close vitest-dev#6237
@github-actions github-actions bot locked and limited conversation to collaborators Aug 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
1 participant