exa-labs / exa-js

MIT License
43 stars 10 forks source link

Fix: Next.js Import Error #10

Closed jiito closed 10 months ago

jiito commented 10 months ago

Description

This PR aims to fix default import errors by eliminating the shim of code that attempted to change the module.exports in CJS. This affects new ESM modules and removed the default import.

Changes

  1. Removed the export changing code from the core package.
  2. Change the next example app to use the latest version of Next.
  3. Updated package dependencies of the node and vite example apps.

Notes

Users who use CJS, it will now be necessary to import Metaphor like so:

const metaphor = require('metaphor-node').default

OR We can add to this PR to manual edit the dist files or run a script to edit them and change the

exports.defualt = Metaphor 

to

module.exports = Metaphor;