nimeshnayaju / yjs-tldraw

Yjs multiplayer implementation on tldraw v1 (POC)
https://opuwd.csb.app/
MIT License
51 stars 6 forks source link

Project won't compile upon yarn start #2

Open adamschwarcz opened 2 years ago

adamschwarcz commented 2 years ago

Hello there,

When I download the project locally and install all the dependencies with yarn install, the dependencies appear to install smoothly. However, upon yarn start, I keep getting this compilation error in my terminal:

./node_modules/@tldraw/tldraw/dist/index.mjs
Attempted import error: 'createStitches' is not exported from '@stitches/react'.

Any recommendations? Am I forgetting some steps or is it not possible to run this project locally?

I also tried deploying thing project through Vercel but I still keep getting error.

Thank you.

githubkoma commented 2 years ago

for me exchanging some packets worked for local deployment. Got rid of your mentioned issue like so:

git clone https://github.com/nimeshnayaju/yjs-tldraw.git
cd yjs-tldraw

edit package.json as follows:

  "dependencies": {
  [...]
      "@tldraw/tldraw": "1.25.0",
  [...]
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-scripts": "5.0.1",
  [...]
yarn
yarn start
  http://localhost:3000
spencerchang commented 2 years ago

I have no idea to solve this issue in my case. I think it's typescript type conflict?

截圖 2022-10-29 上午11 25 56
githubkoma commented 2 years ago

I have no idea to solve this issue in my case. I think it's typescript type conflict?

when you follow the steps mentioned above no such errors should appear

spencerchang commented 2 years ago

Follow the steps without problems but i just realize when only using the latest version "@tldraw/tldraw": "1.26.0" with this issue.

When i downgrade to "@tldraw/tldraw": "1.25.0" can be fine.

The sample file is "@tldraw/tldraw": "1.25.0" so without issues.

grootgordon commented 2 years ago

I got the same error, and then when I change package.json belong like this, and run yarn build again, the results is fine.

[root@centos7 yjs-tldraw]# cat package.json 
{
  "name": "yjs-tldraw",
  "version": "1.0.0",
  "description": "",
  "keywords": [],
  "main": "src/index.tsx",
  "dependencies": {
    "@tldraw/tldraw": "1.25.0",
    "@types/react": "18.0.8",
    "@types/react-dom": "18.0.8",
    "@y-presence/client": "1.1.8",
    "mobx": "6.3.10",
    "react": "18.0.0",
    "react-dom": "18.0.0",
    "react-scripts": "5.0.1",
    "y-websocket": "1.4.0",
    "yjs": "13.6.0-2"
  },
  "devDependencies": {
    "@types/react": "18.0.8",
    "@types/react-dom": "18.0.8",
    "typescript": "4.4.2"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test --env=jsdom",
    "eject": "react-scripts eject"
  },
  "browserslist": [
    ">0.2%",
    "not dead",
    "not ie <= 11",
    "not op_mini all"
  ]
}