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

Attempted import error: 'isNotEmpty' is not exported from 'ramda' (imported as 'isNotEmpty'). #10001

Open
jme-s opened this issue Jun 6, 2024 · 3 comments

Comments

@jme-s
Copy link

jme-s commented Jun 6, 2024

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

@char0n
Copy link
Member

char0n commented Jun 6, 2024

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)

@jme-s
Copy link
Author

jme-s commented Jun 6, 2024

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)

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.

@char0n
Copy link
Member

char0n commented Jun 7, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants