question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when trying to use selfContained optional transform

See original GitHub issue

I’m attempting to use experimental features (specifically async-await) without explicitly importing the regenerator runtime. Using 6to5ify v3.1.2 and going by the 6to5 docs, I expect the following to do the job:

var b = browserify(options)
        .transform(to5ify.configure({
            experimental: true,
            optional: ['selfContained']
        }))
        .require(devPath, {entry: true});

However, 6to5ify throws a wobbly about the transformer:

ReferenceError: unknown transformer selfContained specified in optional while parsing file: /Users/marke/some-project/frontend/scripts/main.js
    at Function.transform._ensureTransformerNames (/Users/marke/some-project/node_modules/6to5ify/node_modules/6to5-core/lib/6to5/transformation/transform.js:28:13)
    at Function.File.normaliseOptions (/Users/marke/some-project/node_modules/6to5ify/node_modules/6to5-core/lib/6to5/file.js:125:13)
    at new File (/Users/marke/some-project/node_modules/6to5ify/node_modules/6to5-core/lib/6to5/file.js:17:32)
    at Object.transform (/Users/marke/some-project/node_modules/6to5ify/node_modules/6to5-core/lib/6to5/transformation/transform.js:11:14)
    at Stream.end (/Users/marke/some-project/node_modules/6to5ify/index.js:39:23)
    at _end (/Users/marke/some-project/node_modules/6to5ify/node_modules/through/index.js:65:9)
    at Stream.stream.end (/Users/marke/some-project/node_modules/6to5ify/node_modules/through/index.js:74:5)
    at Transform.onend (/Users/marke/some-project/node_modules/browserify/node_modules/readable-stream/lib/_stream_readable.js:523:10)
    at Transform.g (events.js:180:16)
    at Transform.emit (events.js:117:20)

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
craigdallimorecommented, Feb 21, 2015

I’ve found that using the regeneratorRuntime with babelify is now achieved like so:

var b = browserify(options)
        .transform(babelify.configure({
            optional: ['runtime']
        }))

note: you will need babel-runtime for this.

0reactions
sebmckcommented, Feb 21, 2015

@craigdallimore Yeah, I recently renamed the selfContained transformer to the more descriptive runtime. You can find out more via the docs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Uses for Optional - java - Stack Overflow
The main design goal of Optional is to provide a means for a function returning a value to indicate the absence of a...
Read more >
Java 8 Optional best practices and wrong usage - Dev in Web
When a method can accept optional parameters, it's preferable to adopt the well-proven approach and design such case using method overloading.
Read more >
Optional in Java: Everything You Need To Know - Tom Gregory
And why is it important enough to bother using Optional ? In this article you'll learn everything you need to know about Optional...
Read more >
Java 8 Optional isPresent(), OrElse() and get() Examples
Optional itself indicates that a value may be present. You just need to take the literal meaning of Optional that value may or...
Read more >
Publish a self-contained .NET app on Azure DevOps
Tutorial to build and publish a console application including the .NET (Core) framework from Azure DevOps Pipelines.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found