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

export 'proxyWithHistory' (imported as 'ph') was not found in 'valtio-history' (module has no exports) #7

Closed
shashtag opened this issue Feb 5, 2024 · 6 comments

Comments

@shashtag
Copy link

shashtag commented Feb 5, 2024

We are trying to add valtio-history to out project and we get the following error.

Screenshot 2024-02-05 at 2 16 07 PM

Out project is a monorepo using turborepo. the following is our package.json

{
  "name": "mapmap-client",
  "version": "10.5.10",
  "private": true,
  "dependencies": {
    "@cassiozen/usestatemachine": "^1.0.1",
    "@convertkit/slate-keymap": "^0.1.10",
    "@emotion/css": "^11.11.2",
    "@fortawesome/fontawesome-svg-core": "^6.4.2",
    "@fortawesome/free-brands-svg-icons": "^6.4.2",
    "@fortawesome/free-solid-svg-icons": "^6.4.2",
    "@fortawesome/react-fontawesome": "^0.2.0",
    "@hassanmojab/react-modern-calendar-datepicker": "^3.1.7",
    "@headlessui/react": "^1.7.17",
    "@mantine/hooks": "^6.0.9",
    "@plasmicapp/react-web": "^0.2.210",
    "@plasmicpkgs/antd5": "^0.0.204",
    "@stripe/react-stripe-js": "^2.2.0",
    "@stripe/stripe-js": "^2.1.3",
    "@tanstack/react-query": "^4.35.7",
    "@tanstack/react-query-devtools": "^4.35.7",
    "@use-gesture/react": "^10.3.0",
    "axios": "^1.5.0",
    "chart.js": "^4.4.0",
    "chroma-js": "^2.4.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-prettier": "^5.1.3",
    "fast-xml-parser": "^4.3.2",
    "feather-icons-react": "^0.6.2",
    "idb-keyval": "^6.2.1",
    "immer": "^10.0.3",
    "localforage": "^1.10.0",
    "lottie-react": "^2.4.0",
    "postcss": "^8.4.29",
    "randomstring": "^1.3.0",
    "react": "^18.2.0",
    "react-chartjs-2": "5.2.0",
    "react-dnd": "^16.0.1",
    "react-dnd-html5-backend": "^16.0.1",
    "react-dom": "^18.2.0",
    "react-resizable": "^3.0.5",
    "react-router-dom": "^6.15.0",
    "react-scripts": "^5.0.1",
    "react-selecto": "^1.26.1",
    "react-transition-group": "^4.4.5",
    "sass": "^1.66.1",
    "slate": "^0.94.1",
    "slate-history": "^0.93.0",
    "slate-react": "^0.99.0",
    "stream": "^0.0.2",
    "timers": "^0.1.1",
    "timers-browserify": "^2.0.12",
    "uuid": "^9.0.1",
    "valtio": "^1.11.3",
    "valtio-history": "^0.2.0",
    "valtio-persist": "^1.0.2",
    "xml2js": "^0.6.2"
  },
  "devDependencies": {
    "@tanstack/eslint-plugin-query": "^4.36.0",
    "@types/chroma-js": "^2.4.3",
    "@types/react": "^18.2.0",
    "@types/react-dom": "^18.2.14",
    "@types/react-resizable": "^3.0.7",
    "@types/uuid": "^9.0.7",
    "autoprefixer": "^10.4.15",
    "node-polyfill-webpack-plugin": "^2.0.1",
    "postcss-cli": "^10.1.0",
    "prettier": "3.0.3",
    "re-resizable": "^6.9.11",
    "tailwindcss": "^3.3.3",
    "typescript": "^5.0.4"
  },
  "scripts": {
    "dev": "react-scripts start & npm run watch:css",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "watch:css": "postcss -w src/css/input.css -o src/css/output.css",
    "format": "prettier --cache --list-different --write ."
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  }
}

From out research we have learned It seems to be an error regarding the webpack build.

The package is working on our other projects and empty projects.

@dai-shi
Copy link
Member

dai-shi commented Feb 5, 2024

I wonder if this is similar to jotaijs/jotai-optics#14.

@lwhiteley
Copy link
Collaborator

can you also show how you are importing the package in the mapStore file?

also is it possible for you to try updating your typescript version:

from "typescript": "^5.0.4" => "typescript": "^5.3.3"

this is kind of a strange error as the exports are "standard" enough to be interpreted.

im trying to see if the issue lies with typescript or turborepo specifically

@lwhiteley
Copy link
Collaborator

lwhiteley commented Feb 5, 2024

Additionally can you also state more environment info like node version as well

  • webpack version
  • turborepo version
  • node version

reading the error a bit more..its saying that the index file is not specifying the file extension of the utility

currently our file has

export * from './history-utility';

can you try to manually update it in your node_modules folder to

export * from './history-utility.js';

let me know if that works.

@lwhiteley
Copy link
Collaborator

lwhiteley commented Feb 5, 2024

ive also found this related to the error

https://webpack.js.org/configuration/module/#resolvefullyspecified

please try to adjust this configuration and see if the error is resolved without manually adding the file extension

@lwhiteley
Copy link
Collaborator

version 0.2.1 was just released..please let me know if this works for you.

@Johannes5
Copy link

Thank you layton. this update solved the error 🕺

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

4 participants