8000 continuation.js missing from dist/commonjs/runtime in Traceur 0.0.110 · Issue #2126 · google/traceur-compiler · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
continuation.js missing from dist/commonjs/runtime in Traceur 0.0.110  #2126
Open
@stuartZhang

Description

@stuartZhang

I upgrade the Google Traceur to the latest 0.0.110. However, the compilation-output ES5 JavaScript program can't work in the web browser.

  1. The transpiling command for Traceur:

node_modules/.bin/traceur
--script=www/js/widget-nest-thermostat.bbjs
--out=www/js/widget-nest-thermostat.js
--require=true
--arrow-functions=true --block-binding=true --classes=true
--computed-property-names=true --default-parameters=true
--destructuring=true --for-of=true --generators=true --numeric-literals=true
--property-methods=true --property-name-shorthand=true --rest-parameters=true
--spread=true --symbols=true --template-literals=true --unicode-escape-sequences=true
--unicode-expressions=true --proper-tail-calls=true --annotations=true
--array-comprehension=true --async-functions=true --async-generators=true
--exponentiation=true --export-from-extended=true --for-on=true
--generator-comprehension=true --member-variables=true --spread-properties=true
--types=true --experimental --source-maps=file

  1. The traceur runtime has been introduced in the HTML page.
<script type="text/javascript" src="/js/traceur-runtime.js"></script>

The file "traceur-runtime.js" is copied from the folder "node_modules/traceur/bin".

  1. The Error is thrown from the web browser, when I visit the web page.
  **TypeError: Cannot read property 'default' of undefined**

By scanning the compilatio-output ES5 JS program, I discovered the error point is

var $__initTailRecursiveFunction = $traceurRuntime.getModule($traceurRuntime.normalizeModuleName("traceur/dist/commonjs/runtime/modules/initTailRecursiveFunction.js", "widget-nest-thermostat.bbjs")).default;

That's to say, $traceurRuntime.getModule($traceurRuntime.normalizeModuleName("traceur/dist/commonjs/runtime/modules/initTailRecursiveFunction.js", "widget-nest-thermostat.bbjs")) returns null.

Memo: in my project, ES6 JS file is suffixed with ".bbjs". After they are compiled, their corresponding ES5 file is ".js".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0