zen-fs / core

A filesystem, anywhere
https://zen-fs.github.io/core/
MIT License
103 stars 14 forks source link

Zenfs does not work with Vite #35

Closed philipp-strack closed 5 months ago

philipp-strack commented 6 months ago

Installing the @zenfs/core package and running "vite" yields the following error

Failed to resolve entry for package "@zenfs/core". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "@zenfs/core" package

james-pre commented 5 months ago

@philipp-strack,

Can you please include an example of the code?

Going off what the error message says, I've added ".": "./dist/index.js", to exports in package.json, and released it as v0.4.1. Does that fix your error?

philipp-strack commented 5 months ago

@james-pre yes, your change indeed fixed the error for the @zenfs/core package, Thank you!!

The same error is present in the @zenfs/dom package. Here is a minimal example of a plain javascript file that reproduces it:

import { configure } from '@zenfs/core'
import { FileSystemAccess } from '@zenfs/dom'

document.querySelector('#app').innerHTML = `
  <div>
    Hello
  </div>
`

The error is

13:46:39 [vite] Pre-transform error: Failed to resolve entry for package "@zenfs/dom". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "@zenfs/dom" package 13:46:39 [vite] Internal server error: Failed to resolve entry for package "@zenfs/dom". The package may have incorrect main/module/exports specified in its package.json: Missing "." specifier in "@zenfs/dom" package

james-pre commented 5 months ago

Got it I'll push out a patch later today.

james-pre commented 5 months ago

The fix is pushed to other repositories, so I'm closing this issue.