question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support for vitejs

See original GitHub issue

Not possible to use with https://github.com/vitejs/vite

I started a new project following vitejs documentation:

npm init vite@latest my-react-app -- --template react

I added all the necessary packages and configurations for @axa-fr/react-oidc-context When I try to import anything from @axa-fr/react-oidc-context vitejs dev server does not start with the following Error:

[plugin: vite:dep-scan] Failed to resolve entry for package “@axa-fr/react-oidc-context”. The package may have incorrect main/module/exports specified in its package.json

Hopefully it is an easy fix. Thank you in advance.

Versions

3.1.7

Screenshots

none

Expected

To work 😃

Actual

It does not work

Additional Details

  • Installed packages:
"dependencies": {
    "@axa-fr/react-oidc-context": "^3.1.7",
    "bootstrap": "^5.1.3",
    "bootstrap-icons": "^1.7.0",
    "dayjs": "^1.10.7",
    "oidc-client": "^1.11.5",
    "react": "^17.0.2",
    "react-bootstrap": "^2.0.1",
    "react-dom": "^17.0.2",
    "react-router-dom": "^5.3.0",
  },
  "devDependencies": {
    "@vitejs/plugin-react": "^1.0.7",
    "vite": "^2.6.13",
    "vite-plugin-svgr": "^0.4.0"
  }
  • vite.config.js file content:
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import svgrPlugin from 'vite-plugin-svgr'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [
    react(),
    svgrPlugin()
  ]
})

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:19 (15 by maintainers)

github_iconTop GitHub Comments

2reactions
honzahrubycommented, Nov 15, 2021

I managed to get it working by adding this to the vite config

resolve: {
  mainFields: ['module', 'main', 'jsnext:main', 'jsnext'],
},
1reaction
honzahrubycommented, Feb 9, 2022

Thank you @guillaume-chervet, that’s some good news. I’m excited about the switch to AppAuthJs 👍 Any chance there will be an alpha release of the redux package as well?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting Started - Vite
Legacy browsers can be supported via the official @vitejs/plugin-legacy - see the Building for Production section for more details.
Read more >
Vite | Next Generation Frontend Tooling
Out-of-the-box support for TypeScript, JSX, CSS and more.. Optimized Build. Pre-configured Rollup build with multi-page and library mode support.
Read more >
Features | Vite
Vite provides first-class Vue support: Vue 3 SFC support via @vitejs/plugin-vue; Vue 3 JSX support via @vitejs/plugin-vue-jsx; Vue 2.7 ...
Read more >
Building for Production - Vite
Legacy browsers can be supported via @vitejs/plugin-legacy, which will automatically generate legacy chunks and corresponding ES language feature polyfills.
Read more >
Vite: Home
Out-of-the-box support for TypeScript, JSX, CSS and more. Optimized Build. Pre-configured Rollup build with multi-page and library mode support.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found