-
I have Must use import to load ES Module: /../20201013130912-user.js.
require() of ES modules is not supported.
Instead rename 20201013130912-user.js to end in .cjs, change the requiring code to use import(), or remove "type": "module"
from package.json Obviously, I can do the renaming but I was wondering if there's a way to do this automatically or another fix, cause I intend to push this to a build tool where I may not be able to rename in the middle of a build. Note: Downgrading my project to Common JS is not an option for now. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 11 replies
-
@ceelogre the readme has some instructions for doing this with typescript modules. Basically at the entry point for your migration script, you call
P.S. I moved this to discussions as I don't think there's a bug here, but the end result could be something added to the docs. |
Beta Was this translation helpful? Give feedback.
-
Good to hear. I'll check it out tomorrow.
Télécharger Outlook pour Android<https://aka.ms/ghei36>
…________________________________
From: Misha Kaletsky <[email protected]>
Sent: Thursday, November 19, 2020 10:31:12 PM
To: sequelize/umzug <[email protected]>
Cc: Samuel Nishimwe <[email protected]>; Mention <[email protected]>
Subject: Re: [sequelize/umzug] Importing seeders for ES Modules (#360)
@ceelogre<https://github.com/ceelogre> see #389<#389>. I published a prerelease CLI package:
npm i [email protected]
It'd be great to get your feedback/to find out if this works with ES modules.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#360 (reply in thread)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABGKIZZPZYL4REHUZ2PON43SQV6BBANCNFSM4SSEW5KA>.
|
Beta Was this translation helpful? Give feedback.
-
@ceelogre CLI is now published on the beta tag ( Note that there may be slight changes to the API before the next major release. For this question you may also be interested in looking at the seeders example. |
Beta Was this translation helpful? Give feedback.
@ceelogre CLI is now published on the beta tag (
npm install umzug@beta
) and there's an example of how you can use it with es modules here: https://github.com/sequelize/umzug/tree/master/examples/2.es-modulesNote that there may be slight changes to the API before the next major release. For this question you may also be interested in looking at the seeders example.