-
Notifications
You must be signed in to change notification settings - Fork 994
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dataMigrate
command import error via babel register
#1845
Conversation
import Listr from 'listr' | ||
import VerboseRenderer from 'listr-verbose-renderer' | ||
import terminalLink from 'terminal-link' | ||
|
||
import { getPaths } from 'src/lib' | ||
import c from 'src/lib/colors' | ||
|
||
require('@babel/register') | ||
babelRequireHook({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seeing this only increases my dislike for babel
dataMigrate
command import error via babel register
Progress. Getting an error but it's a new one: $ yarn rw dm install
yarn run v1.22.10
$ /Users/price/Repos/xx-delete/node_modules/.bin/redwood dm install
/Users/price/Repos/xx-delete/node_modules/@redwoodjs/cli/node_modules/yargs/build/index.cjs:2772
throw err;
^
Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.
In case this error is unexpected for you, please report it in https://github.com/prisma/prisma-client-js/issues/390.
at new PrismaClient (/Users/price/Repos/xx-delete/node_modules/.prisma/client/index.js:3:11)
at Object.<anonymous> (/Users/price/Repos/xx-delete/api/src/lib/db.js:6:19)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Module._compile (/Users/price/Repos/xx-delete/node_modules/pirates/lib/index.js:99:24)
at Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Object.newLoader [as .js] (/Users/price/Repos/xx-delete/node_modules/pirates/lib/index.js:104:7)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. |
I think this is possibly as expected. We could get datamigrate to build the prisma client before, but then it would slow down the whole command. Off the top of my head I think the prisma client is built after rw upgrades and before building api automatically. Should we also have it here? |
@dac09 The new Error: @prisma/client did not initialize yet. Please run "prisma generate" and try to import it again. I did try running |
… fix/dm-babel-register * 'fix/dm-babel-register' of github.com:dac09/redwood: Remove bundlesize dependency (redwoodjs#1844) upgrade execa; fix test.js cwd (redwoodjs#1846) Make ESLint configuration aware of "env." (redwoodjs#1827) Use createMany in Seed database example (redwoodjs#1776) Docs: Update contributor workflow to yarn rwt link (redwoodjs#1803) fix(page-loader): Adds types for pageLoadingContext | Fix for pageLoader during prerender (redwoodjs#1832) Minify CSS in production builds (redwoodjs#1697) New contributor workflow (redwoodjs#1792) Improve/template and auth setup tests (redwoodjs#1834)
Will fill in details tomorrow. Putting here for DP to get early access :)
The
dataMigrate
commands were throwing a strange import error regardingdb.js
and Prisma Client. This PR resolves the import error.