Error: Failed to resolve entry for package "@revenuecat/purchases-capacitor" when running "vitest" · Issue #396 · RevenueCat/purchases-capacitor · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running vitest an error is thrown: Error: Failed to resolve entry for package "@revenuecat/purchases-capacitor". The package may have incorrect main/module/exports specified in its package.json.
This is blocking for us as it prevents our unit tests from succeeding in CI.
Does this means unit test is not possible currently?
I want to migrate from another solution because their testing environment does not really work as it should and I really do not want to land in the same problem.
Uh oh!
There was an error while loading. Please reload this page.
Summary
When running vitest an error is thrown: Error: Failed to resolve entry for package "@revenuecat/purchases-capacitor". The package may have incorrect main/module/exports specified in its package.json.
This is blocking for us as it prevents our unit tests from succeeding in CI.
Version
10.0.2
Minimal Reproduction
Run
npm run test.unit
https://github.com/OkkioXavier/revenue-cat-missing-main-target
Symptoms
When running
npm run test.unit
in the ionic example project with revenuecat configured I get the following error:Error: Failed to resolve entry for package "@revenuecat/purchases-capacitor". The package may have incorrect main/module/exports specified in its package.json.
❯ packageEntryFailure node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:49442:17
❯ resolvePackageEntry node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:49439:5
❯ tryNodeResolve node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:49209:20
❯ Context.resolveId node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:48959:28
❯ Object.resolveId node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:52242:32
❯ TransformContext.resolve node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:51933:23
❯ normalizeUrl node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:67301:34
❯ async file:/***/revenue-cat-missing-main-target/myApp/node_modules/vite/dist/node/chunks/dep-p3C6MpSJ.js:67465:47
The only change I have made to the base template is to add the following lines to App.tsx
Possible cause
The file "dist/plugin.cjs.js" does not exist in the package but is defined in package.json as the entry point in package.json
Modifying
main
from:to
gives me the expected error:
Web not supported in this plugin.
The text was updated successfully, but these errors were encountered: