Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unclear error for missing "source" #23

Closed
JasonEtco opened this issue Jan 29, 2019 · 2 comments
Closed

Unclear error for missing "source" #23

JasonEtco opened this issue Jan 29, 2019 · 2 comments

Comments

@JasonEtco
Copy link
Collaborator

Current Behavior

Tried dropping TSDX into an existing library, and got this:

> [email protected] build /Users/jasonetco/dev/actions-toolkit
> tsdx build

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received type undefined

    at assertPath (path.js:39:11)
    at Object.resolve (path.js:1088:7)
    at Object.exports.resolveApp (/Users/jasonetco/dev/actions-toolkit/node_modules/tsdx/dist/utils.js:19:27)
    at Object.createRollupConfig (/Users/jasonetco/dev/actions-toolkit/node_modules/tsdx/dist/createRollupConfig.js:29:24)
    at createBuildConfigs (/Users/jasonetco/dev/actions-toolkit/node_modules/tsdx/dist/index.js:30:30)
    at prog.command.describe.action (/Users/jasonetco/dev/actions-toolkit/node_modules/tsdx/dist/index.js:130:37)
    at Sade.parse (/Users/jasonetco/dev/actions-toolkit/node_modules/sade/lib/index.js:153:56)
    at Object.<anonymous> (/Users/jasonetco/dev/actions-toolkit/node_modules/tsdx/dist/index.js:168:6)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)

After some 🤔, turns out it was expecting a "source" property in my package.json.

Expected behavior

A handy-dandy error like:

Hey you need a `source` property in your package.json, pointing to the entrypoint of your library

Your environment

Software Version(s)
TSDX v0.0.25
@JasonEtco JasonEtco changed the title Unclear error for missing path Unclear error for missing "source" Jan 29, 2019
@jaredpalmer
Copy link
Owner

Yep.

@jaredpalmer
Copy link
Owner

Source is now the fallback. The default is src/index.ts or src/index.tsx. You can override this by passing --entry src/foo.tsx flag in build or watch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants