Skip to content

Something is wrong with "default" #4481

@audinue

Description

@audinue
// foo.js
export default function foo () {
    console.log('foo')
}
// bar.js
export { default as foo } from './foo'
// baz.js
import { foo } from './bar'
foo()

Works as expected. However...

# foo.coffee
export default foo = ->
    console.log 'foo'
# bar.coffee
export { default as foo } from './foo'
# baz.coffee
import { foo } from './bar'
do foo

Throws: Error transforming bar.coffee: unexpected identifier

This might be related to #4451

The workaround is simply put the backticks around. Or...

import foo from './foo' # Too much work but doable :)
export { foo }

Why do I use CoffeeScript instead of TypeScript and encourage my friends to do so?

Because with CoffeeScript we get the money, quickly. Instead of thinking the unnecessaries and being overwhelmed by code organization and stuffs and being poor software engineers.

Thank you for listening.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions