Attempted import error: 'isNotEmpty' is not exported from 'ramda' (imported as 'isNotEmpty').
Q&A (please complete the following information)
- OS: Windows
- Browser: N/A
- Version: N/A
- Method of installation: npm
- Swagger-UI version: 5.17.14 (swagger-ui-react)
Content & configuration
"dependencies": {
"@agility/content-fetch": "^2.0.0",
"@agility/content-sync": "^1.1.7",
"@agility/nextjs": "^0.4.2",
"@reach/dialog": "^0.18.0",
"@svgr/webpack": "^6.3.1",
"@tanstack/react-query": "^4.29.7",
"axios": "^1.1.3",
"camelize2": "^1.0.0",
"classnames": "^2.3.1",
"cookie": "^0.5.0",
"crypto": "^1.0.1",
"date-fns": "^2.29.3",
"downshift": "^7.0.1",
"framer-motion": "^7.2.1",
"fs": "^0.0.1-security",
"fs-extra": "^10.1.0",
"libphonenumber-js": "^1.10.37",
"lodash-es": "^4.17.21",
"luxon": "^3.2.1",
"next": "^13.5.6",
"next-sitemap": "^3.1.21",
"next-swagger-doc": "^0.4.0",
"postcss-import": "^15.0.0",
"postscribe": "^2.0.8",
"prettier": "^2.7.1",
"react": "^18.2.0",
"react-aria": "^3.20.0",
"react-day-picker": "^8.8.1",
"react-device-detect": "^2.2.3",
"react-dom": "^18.2.0",
"react-google-recaptcha-v3": "^1.10.1",
"react-hook-form": "^7.39.1",
"react-html-parser": "^2.0.2",
"react-loading-skeleton": "^3.1.0",
"react-number-format": "^5.3.1",
"react-slick": "^0.29.0",
"react-use": "^17.4.0",
"slick-carousel": "^1.8.1",
"swagger-ui-react": "^5.17.14",
"tailwindcss": "^3.2.2",
"uuidv4": "^6.2.13"
},
"devDependencies": {
"@babel/core": "^7.19.6",
"@storybook/addon-actions": "^6.5.13",
"@storybook/addon-essentials": "^6.5.13",
"@storybook/addon-interactions": "^6.5.13",
"@storybook/addon-links": "^6.5.13",
"@storybook/builder-webpack5": "^6.5.13",
"@storybook/manager-webpack5": "^6.5.13",
"@storybook/react": "^6.5.13",
"@storybook/testing-library": "^0.0.13",
"@tailwindcss/typography": "^0.5.7",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/react-hooks": "^8.0.1",
"@testing-library/user-event": "^14.4.3",
"@trivago/prettier-plugin-sort-imports": "^3.3.0",
"autoprefixer": "^10.4.13",
"babel-jest": "^29.0.2",
"babel-loader": "^8.2.5",
"browserslist": "^4.22.2",
"cross-env": "^7.0.3",
"dotenv": "^16.0.2",
"eslint": "^8.29.0",
"eslint-config-next": "12.2.5",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-react-hooks": "^4.6.2",
"eslint-plugin-storybook": "^0.6.7",
"identity-obj-proxy": "^3.0.0",
"jest": "^29.0.2",
"jest-environment-jsdom": "^29.0.2",
"jest-junit-reporter": "^1.1.0",
"jest-watch-typeahead": "^2.1.1",
"mockdate": "^3.0.5",
"msw": "^0.47.0",
"postcss": "^8.4.16",
"postcss-import": "^15.0.0",
"slugify": "^1.6.5",
"storybook-addon-next-router": "^4.0.2"
}
Example Swagger/OpenAPI definition: N/A
Swagger-UI configuration options: N/A
Describe the bug you're encountering
nextjs 13.5.6 - build process failure swagger-ui-react -> swagger-client -> ramda-adjunct There appears to be an error in implementation using ramda-adjunct@5 potentially with importing isNotEmpty as I am receiving the following issue on build:
Failed to compile.
./node_modules/ramda-adjunct/es/isNonEmptyArray.js
Attempted import error: 'isNotEmpty' is not exported from 'ramda' (imported as 'isNotEmpty').
Import trace for requested module:
./node_modules/ramda-adjunct/es/isNonEmptyArray.js
./node_modules/ramda-adjunct/es/index.js
./node_modules/swagger-client/es/execute/index.js
./node_modules/swagger-ui-react/swagger-ui.js
./node_modules/swagger-ui-react/index.cjs
./node_modules/ramda-adjunct/es/isNonEmptyString.js
Attempted import error: 'isNotEmpty' is not exported from 'ramda' (imported as 'isNotEmpty').
Import trace for requested module:
./node_modules/ramda-adjunct/es/isNonEmptyString.js
./node_modules/ramda-adjunct/es/index.js
./node_modules/swagger-client/es/execute/index.js
./node_modules/swagger-ui-react/swagger-ui.js
./node_modules/swagger-ui-react/index.cjs
./node_modules/ramda-adjunct/es/overlaps.js
Attempted import error: 'isNotEmpty' is not exported from 'ramda' (imported as 'isNotEmpty').
Import trace for requested module:
./node_modules/ramda-adjunct/es/overlaps.js
./node_modules/ramda-adjunct/es/index.js
./node_modules/swagger-client/es/execute/index.js
./node_modules/swagger-ui-react/swagger-ui.js
./node_modules/swagger-ui-react/index.cjs
> Build failed because of webpack errors
To reproduce...
Steps to reproduce the behavior: Npm build Next while using swagger-ui-react
Expected behavior
Imports will resolve
Screenshots
Additional context or thoughts
Tried Node 16.x.x, 18.x.x 20.x.x - all with the same issue. EDIT: Found this article you wrote @char0n https://medium.com/ramda-adjunct/chore-ramda-adjunct-v5-0-0-905ca0ae6b81
It looks like your dependency tree is corrupted or ambiguous.
I recommend to run npm dedupe or (uninstalling swagger-ui-react and installing it again)
It looks like your dependency tree is corrupted or ambiguous.
I recommend to run
npm dedupeor (uninstalling swagger-ui-react and installing it again)
Thanks for the response however both of those options yield the same issue. Have deleted package-lock and node_modules for full reinstall, then dedupe (default: hoisted) and unfortunately the exact same issue occurs.
I can reproduce this issue locally and on the pipelines which are cleaned every run.
Try inspecting the package-lock.json and see if there are multiple installations of ramda. It seems that your dep tree might contain more versions of ramda. Given that ramda still uses 0.x.y versioning scheme and they are introducing breaking changes arbitrarily it might happen. If this is the case npm overrides could be used to resolve the issue.
Having same problem
Is there a solution to this? I'm having the same issue. I've upgraded to the latest version. Issue persists.
Try to put this into your package.json file:
{
...
"overrides": {
"swagger-client": {
"ramda": "=0.30.1",
"ramda-adjunct": "=5.1.0"
}
}
...
}
We're pinning versions to make sure that SwaggerUI will always install the correct versions for itself independent of other dependencies in your tree.
Hello everyone,
I am migrating our Next application from version 15.0.0-canary.37 to version 15.0.3 (by enabling turbopack).
I simply used the codemod to update the relevant packages and updated the breaking change.
While this worked perfectly before the Next migration, since then I've had exactly the same error. So I checked the package-lock.json file to identify the ramda versions involved. I then applied overrides. It doesn't change anything.
What's strange is that if I disable turbo locally so that webpack can take control, I don't get any errors (any more than with turbo enabled, by the way).
On the other hand, it's only when building my PR on github that I get this error.
Is there anything you can investigate?
package.json
{
...
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
"prepare": "husky",
"test": "vitest run --exclude \"**/e2e-tests/**\"",
"test-api": "vitest run e2e-tests",
"lingui:extract": "lingui extract",
"lingui:compile": "lingui compile --typescript"
},
"dependencies": {
"@ai-sdk/openai": "^0.0.60",
"@lingui/react": "^4.14.1",
"@lingui/vite-plugin": "^4.14.1",
"@opentelemetry/auto-instrumentations-node": "^0.47.1",
"@opentelemetry/exporter-jaeger": "^1.25.0",
"@opentelemetry/exporter-prometheus": "^0.52.0",
"@opentelemetry/exporter-trace-otlp-grpc": "^0.52.0",
"@opentelemetry/resources": "^1.25.0",
"@opentelemetry/sdk-metrics": "^1.25.0",
"@opentelemetry/sdk-node": "^0.52.0",
"@opentelemetry/sdk-trace-node": "^1.25.0",
"@opentelemetry/semantic-conventions": "^1.25.0",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.2",
"@radix-ui/react-dropdown-menu": "^2.1.2",
"@radix-ui/react-label": "^2.1.0",
"@radix-ui/react-navigation-menu": "^1.2.1",
"@radix-ui/react-scroll-area": "^1.2.1",
"@radix-ui/react-select": "^2.1.2",
"@radix-ui/react-separator": "^1.1.0",
"@radix-ui/react-slot": "^1.1.0",
"@radix-ui/react-switch": "^1.1.1",
"@radix-ui/react-tooltip": "^1.1.4",
"@tanstack/react-query": "^5.44.0",
"@types/swagger-ui-react": "^4.18.3",
"@uppy/core": "^4.2.1",
"@uppy/dashboard": "^4.1.0",
"@uppy/drag-drop": "^4.0.2",
"@uppy/file-input": "^4.0.1",
"@uppy/locales": "^4.2.0",
"@uppy/onedrive": "^4.1.0",
"@uppy/progress-bar": "^4.0.0",
"@uppy/react": "^4.0.2",
"@uppy/xhr-upload": "^4.2.0",
"@vitejs/plugin-react": "^4.3.1",
"ai": "3.3.40",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"dataloader": "^2.2.2",
"file-saver": "^2.0.5",
"hmac-drbg": "^1.0.1",
"ioredis": "^5.4.1",
"jose": "^5.6.3",
"js-tiktoken": "^1.0.12",
"lodash": "^4.17.21",
"lru-cache": "^10.2.2",
"lucide-react": "^0.394.0",
"markdown-to-jsx": "^7.4.7",
"mermaid": "^10.9.3",
"nanoid": "^5.0.7",
"negotiator": "^0.6.3",
"next": "15.0.3",
"next-themes": "^0.3.0",
"openai": "^4.55.1",
"openid-client": "^5.6.5",
"p-retry": "^6.2.0",
"pino": "^9.2.0",
"posthog-js": "^1.164.1",
"posthog-node": "^4.2.0",
"rate-limiter-flexible": "^5.0.3",
"react": "19.0.0-rc-66855b96-20241106",
"react-dom": "19.0.0-rc-66855b96-20241106",
"react-resizable-panels": "^2.0.19",
"react-textarea-autosize": "^8.5.3",
"server-only": "^0.0.1",
"swagger-ui-react": "^5.18.2",
"tailwind-merge": "^2.3.0",
"tailwindcss-animate": "^1.0.7",
"usehooks-ts": "^3.1.0",
"weaviate-ts-client": "^2.2.0",
"yaml": "^2.5.0",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.0"
},
"devDependencies": {
"@lingui/cli": "^4.14.1",
"@lingui/loader": "^4.14.1",
"@lingui/macro": "^4.14.1",
"@lingui/swc-plugin": "^4.1.0",
"@playwright/test": "^1.47.2",
"@tailwindcss/typography": "^0.5.13",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/file-saver": "^2.0.7",
"@types/lodash": "^4.17.5",
"@types/negotiator": "^0.6.3",
"@types/node": "^22",
"@types/pdf-parse": "^1.1.4",
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"autoprefixer": "^10.4.19",
"eslint": "^8.57.0",
"eslint-config-next": "15.0.3",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-lingui": "^0.7.0",
"eslint-plugin-tailwindcss": "^3.17.4",
"husky": "^9.0.11",
"jsdom": "^24.1.0",
"lint-staged": "^15.2.6",
"msw": "^2.3.1",
"postcss": "^8",
"prettier": "^3.3.2",
"sass": "^1.81.0",
"tailwindcss": "^3.4.4",
"typescript": "^5",
"typescript-eslint": "^7.18.0",
"vitest": "^1.6.0"
},
"overrides": {
"@types/react": "npm:[email protected]",
"@types/react-dom": "npm:[email protected]",
"swagger-client": {
"ramda": "=0.30.1",
"ramda-adjunct": "=5.0.0"
}
}
}
next.config
/** @type {import('next').NextConfig} */
const nextConfig = {
output: "standalone",
webpack: (config) => {
config.module.rules.push({
test: /\.po$/,
use: {
loader: "@lingui/loader",
},
});
return config;
},
experimental: {
swcPlugins: [["@lingui/swc-plugin", {}]],
turbo: {
rules: {
"*.po": {
loaders: ["@lingui/loader"],
as: "*.js",
},
},
},
},
// This option can be removed when this PR is merged: https://github.com/vercel/next.js/pull/72423 and the version of next.js released.
sassOptions: {
silenceDeprecations: ["legacy-js-api"],
},
};
module.exports = nextConfig;
I am getting the same error. Has anyone found a solution for this?
As for me, it's probably a deduplication problem.
As you can see, [email protected] doesn't use the correct version of ramda, even though this is indicated in its package.json file.
But it's impossible at the moment to impose [email protected] with the override, it's a crazy thing.
npm ls ramda
├─┬ @lingui/[email protected]
│ └── [email protected]
└─┬ [email protected]
└─┬ [email protected] overridden
├─┬ @swagger-api/[email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ @swagger-api/[email protected]
│ └── [email protected]
├─┬ @swagger-api/[email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ ├─┬ @swagger-api/[email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ @swagger-api/[email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ ├─┬ @swagger-api/[email protected]
│ │ │ ├─┬ @swagger-api/[email protected]
│ │ │ │ └── [email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ ├─┬ @swagger-api/[email protected]
│ │ │ └── [email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ ├─┬ @swagger-api/[email protected]
│ │ └── [email protected]
│ └── [email protected]
├─┬ [email protected]
│ └── [email protected] deduped invalid: ">= 0.30.0" from node_modules/ramda-adjunct
└── [email protected]
The update of Lingui to version 5 fixes the issue.
I'm glad it work out for you eventually. Please reopen if you still seeing this issue.