firecms icon indicating copy to clipboard operation
firecms copied to clipboard

Bug with build on new CLI project, version Community

Open marianmoldovan opened this issue 11 months ago • 7 comments

After creating a community project with the CLI, and with this config:

{
  "name": "my-firecms-project",
  "version": "1.0.0",
  "private": true,
  "type": "module",
  "dependencies": {
    "@firecms/core": "^3.0.0-beta",
    "@firecms/firebase": "^3.0.0-beta",
    "@firecms/ui": "^3.0.0-beta",
    "firebase": "^10.14.0",
    "react": "^18.3.1",
    "react-dom": "^18.3.1",
    "react-router": "^6.26.2",
    "react-router-dom": "^6.26.2"
  },
  "scripts": {
    "dev": "vite --mode development",
    "build": "vite build && tsc",
    "preview": "vite build && vite preview",
    "deploy": "vite build && firebase deploy --only hosting --project pulse-map-c3211"
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@tailwindcss/typography": "^0.5.15",
    "@types/react": "^18.3.11",
    "@types/react-dom": "18.3.0",
    "@typescript-eslint/eslint-plugin": "^8.8.1",
    "@typescript-eslint/parser": "^8.8.1",
    "@vitejs/plugin-react": "^4.3.2",
    "autoprefixer": "^10.4.20",
    "eslint": "^9.12.0",
    "eslint-plugin-import": "^2.31.0",
    "eslint-plugin-n": "^17.11.1",
    "eslint-plugin-promise": "^7.1.0",
    "eslint-plugin-react": "^7.37.1",
    "eslint-plugin-react-hooks": "^5.1.0",
    "eslint-plugin-react-refresh": "^0.4.12",
    "postcss": "^8.4.47",
    "tailwindcss": "^3.4.13",
    "typescript": "^5.6.3",
    "vite": "^5.4.8",
    "vite-plugin-svgr": "^4.2.0"
  }
}

I am retrieving this error on build:

[email protected] build vite build && tsc

vite v5.4.14 building for production... ✓ 1551 modules transformed. x Build failed in 6.55s error during build: node_modules/@firecms/editor/dist/index.es.js (33:71): "__serializeForClipboard" is not exported by "node_modules/@tiptap/pm/view/dist/index.js", imported by "node_modules/@firecms/editor/dist/index.es.js". file: /Users/marian/Code/folder/pulse-map-cms/node_modules/@firecms/editor/dist/index.es.js:33:71

31: import Blockquote from "@tiptap/extension-blockquote"; 32: import Code from "@tiptap/extension-code"; 33: import { DecorationSet as DecorationSet$1, Decoration as Decoration$1, __serializeForClipboard } from "@tiptap/pm/view"; ^ 34: import { PluginKey as PluginKey$1, Plugin as Plugin$1, NodeSelection } from "@tiptap/pm/state"; 35: import Suggestion from "@tiptap/suggestion";

at getRollupError (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/parseAst.js:397:41)
at error (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/parseAst.js:393:42)
at Module.error (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:16603:16)
at Module.traceVariable (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:17052:29)
at ModuleScope.findVariable (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:14709:39)
at FunctionScope.findVariable (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:5582:38)
at FunctionBodyScope.findVariable (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:5582:38)
at FunctionScope.findVariable (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:5582:38)
at FunctionBodyScope.findVariable (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:5582:38)
at Identifier.bind (file:///Users/marian/Code/folder/pulse-map-cms/node_modules/rollup/dist/es/shared/node-entry.js:5356:40)

marianmoldovan avatar Feb 18 '25 14:02 marianmoldovan

It is an issue with prosemirror and tiptap. As a workaround, you can set manually the dep: "prosemirror-view": "^1.37.2" while we fix it

fgatti675 avatar Feb 19 '25 18:02 fgatti675

Adding the dependency did not help unfortunately, I still can't build the project

LukasAnda avatar Feb 20 '25 13:02 LukasAnda

Hi @LukasAnda ,

Following this steps did the job for me:

  1. Add the "prosemirror-view": "1.37.2" in your package.json
  2. Remove package-lock.json and node_modules
  3. npm i

Can you please try again?

marianmoldovan avatar Feb 20 '25 15:02 marianmoldovan

Yes, running using npm seems fine. I was originally using yarn, that one is still broken

LukasAnda avatar Feb 20 '25 16:02 LukasAnda

I'm getting the same error. I had been using yarn; but switched to npm and get the same error.

mhjb avatar Feb 23 '25 19:02 mhjb

This has been fixed in version 3.0.0-canary.190. And it works with pnpm and npm.

Please update, remove and clean the cache and should be working.

As yarn, has a different dependencies management, you can use:

  "resolutions": {
    "prosemirror-view": "1.37.2"
  },

marianmoldovan avatar Feb 24 '25 12:02 marianmoldovan

That did the trick thanks @marianmoldovan !

mhjb avatar Feb 24 '25 22:02 mhjb