ics icon indicating copy to clipboard operation
ics copied to clipboard

Issues with runes2 import

Open peoplenarthax opened this issue 1 year ago • 6 comments

Info:

  React application w/o Typescript
  node version: 18.19.0
   "dependencies": {
    "ics": "3.5.0",
    "react": "^17.0.0",
    "react-dom": "^17.0.0",
    "react-scripts": "5.0.1",
    "styled-components": "^6.1.6",
  },

When running createEvents (I presume is the same issue with createEvent or anything that calls fold-line), it always returns error:

TypeError: (0 , _runes.default) is not a function
    at foldLine (fold-line.js:12:1)
    at formatHeader (format.js:21:1)
    at run (index.js:56:1)
    at Object.createEvents (index.js:75:1)
    at EventsManager.toICS (index.js:54:1)
    at createICS (App.js:48:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js:3945:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:3994:1)
    at invokeGuardedCallback (react-dom.development.js:4056:1)
    at invokeGuardedCallbackAndCatchFirstError (react-dom.development.js:4070:1)

And it is because _runes after resolving import looks like this:

{
    "default": "/static/media/index.17ec02c86117f90a327b.cjs"
}

I guess it has to do with resolving CJS instead of ESM in the build.

I believe there should be a way of fixing this by fixing how the build is done

peoplenarthax avatar Jan 06 '24 20:01 peoplenarthax

I have a similar issue: image

Earu avatar Jan 27 '24 12:01 Earu

Bumping this as I am facing the same issue. Using it in the browser using skypack.dev.

morkro avatar Feb 14 '24 13:02 morkro

Upgraded package from 3.2.0 to 3.7.2 and I'm getting a similar error.

image

tflemHAK avatar Feb 23 '24 01:02 tflemHAK

same here

platdesign avatar Mar 12 '24 12:03 platdesign

ics version 2.44.0 is working for me and it would be great if the maintainer merges the existing PR to fix this issue, thanks in advance.

jqn avatar Apr 07 '24 10:04 jqn

I have a similar issue: image

I've got this in 3.7.2

Latest version where the issue doesn't occur for me: 3.6.3

tcarvalho-mobinteg avatar Apr 15 '24 15:04 tcarvalho-mobinteg

Should be fixed by #266

adamgibbons avatar Jun 11 '24 15:06 adamgibbons