Skip to content

ReferenceError: exports is not defined (OSX) #309

@svr93

Description

@svr93

I have an error message if I use lib with attached typings (e.g. moment, lodash):

import * as moment from 'moment'
ReferenceError: exports is not defined
    at [eval].ts:2:23
    at ContextifyScript.Script.runInContext (vm.js:35:29)
    at ContextifyScript.Script.runInNewContext (vm.js:41:15)
    at _eval (/Users/shamsheev/.nvm/versions/node/v6.4.0/lib/node_modules/ts-node/dist/_bin.js:181:29)
    at REPLServer.replEval (/Users/shamsheev/.nvm/versions/node/v6.4.0/lib/node_modules/ts-node/dist/_bin.js:219:18)
    at bound (domain.js:280:14)
    at REPLServer.runBound [as eval] (domain.js:293:12)
    at REPLServer.<anonymous> (repl.js:503:10)
    at emitOne (events.js:96:13)
    at REPLServer.emit (events.js:188:7)

But I can use library after error without any problems.
ts-node v3.0.2
node v6.4.0
tsc Version 2.2.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugexternalresearchNeeds design work, investigation, or prototyping. Implementation uncertain.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions