traverse1984 / oxide.ts

Rust's Option<T> and Result<T, E>, implemented for TypeScript.
MIT License
517 stars 19 forks source link

Fix exports in package.json #16

Closed yaser-abclabs closed 1 year ago

yaser-abclabs commented 1 year ago

When importing the package, it will complain and show this message:

Error: Package subpath './dist' is not defined by "exports" in /Users/yaser/dev/my-project/node_modules/oxide.ts/package.json
at new NodeError (node:internal/errors:387:5)
at throwExportsNotFound (node:internal/modules/esm/resolve:439:9)
at packageExportsResolve (node:internal/modules/esm/resolve:718:3)
at resolveExports (node:internal/modules/cjs/loader:493:36)
at Function.Module._findPath (node:internal/modules/cjs/loader:533:31)
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:942:27)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Module.require (node:internal/modules/cjs/loader:1022:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/Users/yaser/dev/my-project/src/results/service.ts:14:1)
[ERROR] 16:15:04 Error: Package subpath './dist' is not defined by "exports" in /Users/yaser/dev/my-project/node_modules/oxide.ts/package.json

This issue is similar to this issue in jasmine-ts: https://stackoverflow.com/a/72840981/4565520

yaser-abclabs commented 1 year ago

Closing this as I realized that instead of:

import { Err, Ok, Result } from 'oxide.ts/dist';

It should be:

import { Err, Ok, Result } from 'oxide.ts';