#Issues importing in VitePlugin portion of the AstroIntegration

5 messages · Page 1 of 1 (latest)

fresh karma
#

I'm working on an integration to provide support for orgmode files. I'm loosely basing my integration off of the MDX integration in the Astro project. Looking at the MDX integration, it imports node:fs/promise and then uses that module to await the .readFile method. As best as I can tell my integration is setup identically to the MDX one, however I am unable to either import the fs module or call the .readFile method. I get error __vite_ssr_import_0__.default.readFle is not a function. I assume that Vite is attempting to bundle this nodejs module, but I am unclear on how to designate it as external and I am unsure where the MDX integration is doing this.

loud osprey
#

error vite_ssr_import_0.default.readFle is not a function
Is the readFle here a typo?

fresh karma
#

I typed the error out instead of copy/pasting it.

loud osprey
#

Oh it's not what I thought so

#

Also in node:fs/promise , you forgot the trailing "s"; its node:fs/promises or is it a typo in the question too?