davesnx / styled-ppx

Type-safe styled components for ReScript, Melange and native with type-safe CSS
https://styled-ppx.vercel.app
BSD 2-Clause "Simplified" License
399 stars 31 forks source link

Css_Legacy_Core.ml:1616:17-39 This function is a curried function where an uncurried function is expected #463

Closed misogihagi closed 3 months ago

misogihagi commented 3 months ago

I am new to rescript. When I wanted to use styled-components with rescript, I found this repository.

Then running npm create rescript-app like following

◇ Select a template │ Vite ◇ ReScript version? │ 11.0.1 ◇ ReScript Core version? │ 1.2.0

npm install @davesnx/styled-ppx and editing rescript.json

{
  "name": "test",
  "sources": [
    {
      "dir": "src",
      "subdirs": true
    }
  ],
  "package-specs": [
    {
      "module": "es6",
      "in-source": true
    }
  ],
  "suffix": ".res.mjs",
  "bs-dependencies": [
    "@rescript/core",
    "@rescript/react",
    "@davesnx/styled-ppx/css",
    "@davesnx/styled-ppx/emotion"
  ],
  "ppx-flags": ["@davesnx/styled-ppx/ppx"],
  "bsc-flags": [
    "-open RescriptCore"
  ],
  "jsx": {
    "version": 4
  }
}

I encountered the following error

> rescript -w

>>>> Start compiling
Dependency on @rescript/core
Dependency on @rescript/react
Dependency on @davesnx/styled-ppx/css
rescript: [1/1] Css_Legacy_Core.cmj
FAILED: Css_Legacy_Core.cmj

  We've found a bug for you!
  packages/css/js/Css_Legacy_Core.ml:1616:17-39

  This function is a curried function where an uncurried function is expected

FAILED: cannot make progress due to previous errors.

How can I solve this problem?

zakybilfagih commented 3 months ago

Currently, only the library only supports ReScript v10 and v9. So you will need to downgrade your ReScript version.

davesnx commented 3 months ago

Indeed, styled-ppx doesn't support ReScript v11 yet. I made to peerDepend on v9 or v10 in the package.json: https://github.com/davesnx/styled-ppx/blob/main/package.json#L29 so you might have seen a warning when installing.

This is the task related with v11: https://github.com/davesnx/styled-ppx/issues/415

misogihagi commented 3 months ago

currently, It works on this dependencies:

  "dependencies": {
    "@rescript/core": "0.7.0",
    "@rescript/react": "0.11.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "rescript": "^10.1.4"
  },

but styled components does not work by the other reason...