redwoodjs / example-invoice Goto Github PK
View Code? Open in Web Editor NEWExample Invoice app written with Redwood
License: MIT License
Example Invoice app written with Redwood
License: MIT License
packages
workspace@redwoodjs/auth
packageauth0
to be passed into Providerauth0
methods to our own hooks, and exportsRedwoodProvider
an optional consumer of the AuthProvider
so that it can pass the authToken
along with the requests to the api side.as discussed in redwoodjs/redwood#1734 (comment), <RedwoodProvider>
needs to be replaced by <RedwoodApolloProvider>
to work with 0.24.0 (breaking change)
After installing all the deps and running db up / db generate
I'm getting this error:
/example-invoice/node_modules/.bin/rw dev
✔ Generating the Prisma client...
error Command "prisma2" not found.
error Command "dev-server" not found.
error Command "webpack-dev-server" not found.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
09:45:30 api | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn dev-server exited with code 1
09:45:30 db | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn prisma2 generate --watch exited with code 1
09:45:30 web | cd /Users/<user>/workspace/projects/testapps/example-invoice/web && yarn webpack-dev-server --config ../node_modules/@redwoodjs/core/config/webpack.development.js exited with code 1
09:45:30 api | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn dev-server restarted
09:45:30 db | cd /Users/<user>/workspace/projects/testapps/example-invoice/api && yarn prisma2 generate --watch restarted
09:45:30 web | cd /Users/<user>/workspace/projects/testapps/example-invoice/web && yarn webpack-dev-server --config ../node_modules/@redwoodjs/core/config/webpack.development.js restarted
undefined
I have everything setup, afaik
$ webpack-dev-server --version
webpack-dev-server 3.10.3
webpack 4.41.6
$ prisma2 --version
[email protected], binary version: 377df4fe30aa992f13f1ba152cf83d5770bdbc85
The most recent code is in master
. I pulled in changes from pp-deploy-to-netlify
, including file updates from the latest CRA and RWJS v0.2.5. And then created netlify-deploy-example
with specific settings for deploy. Deploy is working, however, I disabled the "Save" button.
I could have sworn the "Save" functionality worked at once point in time. But now, if you make a change and Save, the app errors on refresh or restart. Here's the console message:
Uncaught TypeError: Cannot read property '0' of null
at LineItems.js:36
at Array.map (<anonymous>)
at LineItems (LineItems.js:15)
at renderWithHooks (react-dom.development.js:14825)
at mountIndeterminateComponent (react-dom.development.js:17505)
at beginWork (react-dom.development.js:18629)
at HTMLUnknownElement.callCallback (react-dom.development.js:188)
at Object.invokeGuardedCallbackDev (react-dom.development.js:237)
at invokeGuardedCallback (react-dom.development.js:292)
at beginWork$1 (react-dom.development.js:23234)
@peterp Would it be possible to drop the Production DB _migrations
table so we can deploy the latest code in main
? Here's the most recent deploy log and error output:
https://app.netlify.com/sites/redwood-example-invoice/deploys/5f84cbd921618a000779e858
2:36:53 PM: Migrate database up... [started]
2:36:53 PM: $ /opt/build/repo/node_modules/.bin/prisma migrate up --experimental --create-db --auto-approve
2:36:55 PM: Error: Local and remote migrations are not in lockstep. We have migration 20200730175800-migration locally and 20200227093425 remotely at the same position in the history.
2:36:55 PM: error Command failed with exit code 1.
2:36:55 PM: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
2:36:56 PM: Migrate database up... [failed]
2:36:56 PM: → Command failed with exit code 1: yarn prisma migrate up --experimental --create-db --auto-approve
2:36:56 PM: Command failed with exit code 1: yarn prisma migrate up --experimental --create-db --auto-approve
cc @dale-french
After installing the dependencies and do "db up" the comment "db seed" returns the following error message:
Argument id: Got invalid value 1 on prisma.findOneInvoice. Provided Int, expected String.
Due to the Prisma deploy error specific to Node v12.19.0, I've changed .nvmrc
based on redwoodjs/redwood#1313
Once Redwood is using Prisma v2.9.0 and this project has been upgraded, we should revert .nvmrc
to:
lts/*
continued from #43
cc @dale-french
Here's the current behavior actual / expected.
Use an existing account to log in:
Create a new account, verify, and auto-login:
Logout
The Save button was creating DB and GraphQL error upon refresh and restart. (Sorry, didn't think to copy console messages here.) Most likely due to update in Prisma2 package in our v0.2.5
api/src/services/invoice.js
NOTE: currently this is deployed to Netlify as a live example. Once this is fixed, we don't want the SAVE functionality deployed ('cause people...). We should either:
a) create a separate deploy branch for Netlify with SAVE disabled, or
b) add instructions to README about how to enable
The Invoice service relies on "context.currentUser?.id" to create an Invoice, which doesn't work running "yarn rw db seed"
Seems tricky to establish user context within the seed.js file, so I was trying to seed a user first and providing that but couldn't get it to work.
Still learning the ins and outs of Prisma and Redwood and don't totally understand the input types it asks for while creating the Invoice while providing a User but it seems possible
https://redwood-example-invoice.netlify.app/#
"Try it out" doesn't work (does a POST graphql with 500 response)
"Get started" says Logged in as test
Got the following error when attempting to seed the database. I checked the code and it seems that the context object is not defined or something like. I am very new react and JS in general but I am will participate in getting this resolved.
/Users/xxxx/project/JS/example-invoice/node_modules/.bin/rw db seed Seeding your database... [started] PrismaClientValidationError: Invalid
prisma.invoice.create()` invocation in
/Users/aaliu/project/JS/example-invoice/api/prisma/seeds.js:36:38
{
data: {
invoiceNumber: '2020001',
date: '03/12/2020',
body: '{"title":"I N V O I C E","companyName":"Example Inc.","companyInfo":"example.com\[email protected]","recipient":"Michael Scott Paper Company Inc.\n1725 Slough Avenue\nScranton, Pennsylvania","information":[[{"value":"Invoice #"},{"value":"044"}],[{"value":"Date"},{"value":"7/25/2020"}]],"lineItems":[[{"value":"Description"},{"value":"Quantity"},{"value":"Price"}],[{"value":"Wheel of cheese"},{"value":1},{"value":500}],[{"value":"Jar of sausages"},{"value":2},{"value":2.99}],[{"value":"Tin of waffles"},{"value":2},{"value":3.01}]],"summary":[[{"value":"Subtotal"},null,"0.0"],[{"value":"Tax Rate"},{"value":0},"0.0"],[{"value":"Total"},{"value":"$"},"0.0"]],"notesA":"","notesB":"Invoice by billable.me"}',
create?: UserCreateWithoutInvoicesInput,
connect?: UserWhereUniqueInput
Argument user for data.user is missing.
`
Let me if you have questions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.