rest icon indicating copy to clipboard operation
rest copied to clipboard

[ts] Declaration or statement expected. [1128]

Open ingmontoya opened this issue 7 years ago • 4 comments

i'm getting this error in my VS Code

[ts] Declaration or statement expected. [1128] in the line : export User, { schema } from './model' located in every index.js file. image

Please help

ingmontoya avatar Jan 20 '19 20:01 ingmontoya

Export from syntax is somehow stale right now (still in stage 1): https://github.com/tc39/proposal-export-default-from. This syntax is not encouraged.

To make it work:

Replace in index.js: export User, {schema} from './model' with import { schema } from './model'

Replace in controller.js import { User } from '.' with import User from './model'

If I may suggest, Babel is a bit unnecessary in this project. You can simple replace it with esm package or just use Node 13 with native ESM support.

kbzowski avatar Mar 01 '20 08:03 kbzowski

I also had an error with that Screen Shot 2022-02-16 at 8 04 11 PM .

GitHubBoy88 avatar Feb 17 '22 03:02 GitHubBoy88

I also had an error with that Screen Shot 2022-02-16 at 8 04 11 PM .

Hello, having kind of the same problem here. Did you find the solution?

Josh1540 avatar Jul 27 '22 12:07 Josh1540

if (condition) {

} else {

}

mohamedaithamou avatar Feb 06 '24 10:02 mohamedaithamou