Skip to content
This repository has been archived by the owner on May 24, 2019. It is now read-only.

Not Working With .mjs files #70

Open
pizzarob opened this issue Aug 11, 2018 · 2 comments
Open

Not Working With .mjs files #70

pizzarob opened this issue Aug 11, 2018 · 2 comments
Labels

Comments

@pizzarob
Copy link

This does not seem to be removing types from .mjs files.

type TSignUpBody = {
     ^^^^^^^^^^^
SyntaxError: Unexpected identifier

Starting the server using:

import 'flow-remove-types/register';
import './index.mjs';
@motiz88 motiz88 added the bug label Feb 15, 2019
@motiz88
Copy link
Contributor

motiz88 commented Feb 15, 2019

Looks like we do support .mjs as of #53. @pizza-r0b, if you can still reproduce this, what are you using for import support? And does your .mjs file have a // @flow comment?

@dmnd
Copy link

dmnd commented Mar 23, 2019

I tried to use --experimental-modules for modules and it didn't work:

$ yarn flow-node --experimental-modules snipper.mjs 
yarn run v1.10.1
$ /Users/dmnd/github/snipper/node_modules/.bin/flow-node --experimental-modules snipper.mjs
(node:71092) ExperimentalWarning: The ESM module loader is experimental.
file:///Users/dmnd/github/snipper/snipper.mjs:9
type Event =
     ^^^^^

SyntaxError: Unexpected identifier
    at translators.set (internal/modules/esm/translators.js:48:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

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

No branches or pull requests

3 participants