remix-run / grunge-stack Goto Github PK
View Code? Open in Web Editor NEWThe Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.
Home Page: https://remix.run/stacks
License: MIT License
The Remix Stack for deploying to AWS with DynamoDB, authentication, testing, linting, formatting, etc.
Home Page: https://remix.run/stacks
License: MIT License
npx create-remix@latest --template remix-run/grunge-stack
HP-ProBook-450-G3:~$ npx create-remix@latest --template remix-run/grunge-stack
(node:24084) [DEP0040] DeprecationWarning: The punycode
module is deprecated. Please use a userland alternative instead.
(Use node --trace-deprecation ...
to show where the warning was created)
remix v2.4.0 πΏ Let's build a better website...
dir Where should we create your new project?
./remixawstest
Setup finishes without errors. Go ahead..
βΌ Template: Using remix-run/grunge-stack...
β Template copied
git Initialize a new git repository?
Yes
deps Install dependencies with npm?
Yes
init This template has a remix.init script. Do you want to run it?
Yes
ββββββ Dependencies installing with npm...
β² Oh no! Failed to install dependencies.
It's my first time using Architect, and I've really enjoyed Remix! Really excited about this combo.
When following the getting started guide, in the Deployment section
β οΈ Warning: The environment variable "ARC_APP_SECRET" is not set - please set this in production to help mitigate potential session-related attacks!
Looking at the Architect docs on security, it definitely seems important to set.
Perhaps
npx arc env --add --env production ARC_APP_SECRET $(openssl rand -hex 32)
Should be added to the docs above the other production secret being set? I can make a quick PR if that makes sense.
Yes
@architect/architect
to >=10.6
npm run dev
Arc sandbox should detect the server file and run without issue.
There is a race condition between remix watch
and void arc()
that results in arc intermittently not being able to find the server build artifact. This happens pretty consistently on first boot or if the server/
directory is deleted before the build.
Yeah
npm run dev
Expected application to run normally.
Following error thrown in cmd and application is not started
internal/modules/cjs/loader.js:456
throw e;
^
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib' is not defined by "exports" in /Users/chenchunaidu/Programming/Personal/Product/recomnd/node_modules/headers-polyfill/package.json
at new NodeError (internal/errors.js:322:7)
at throwExportsNotFound (internal/modules/esm/resolve.js:332:9)
at packageExportsResolve (internal/modules/esm/resolve.js:565:3)
at resolveExports (internal/modules/cjs/loader.js:450:36)
at Function.Module._findPath (internal/modules/cjs/loader.js:490:31)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:888:27)
at Function.Module._load (internal/modules/cjs/loader.js:746:27)
at Module.require (internal/modules/cjs/loader.js:974:19)
at require (internal/modules/cjs/helpers.js:101:18)
at Object.<anonymous> (/Users/chenchunaidu/Programming/Personal/Product/recomnd/node_modules/msw/src/utils/request/MockedRequest.ts:5:25)
yes
Following the readme step for step:
npx create-remix@latest --template remix-run/grunge-stack
npm run validate
npm run dev
npx arc env --add --env staging ARC_APP_SECRET $(openssl rand -hex 32)
npx arc env --add --env staging SESSION_SECRET $(openssl rand -hex 32)
npx arc env --add --env production ARC_APP_SECRET $(openssl rand -hex 32)
npx arc env --add --env production SESSION_SECRET $(openssl rand -hex 32)
{"message":"Internal Server Error"}
2023-09-23T20:08:57.792Z da801d89-8960-42c2-b45e-c3f84c59da2a ERROR Invoke Error {
"errorType": "ReferenceError",
"errorMessage": "Request is not defined",
"stack": [
"ReferenceError: Request is not defined",
" at createRemixRequest (/var/task/node_modules/@remix-run/architect/dist/server.js:53:3)",
" at Runtime.handler (/var/task/node_modules/@remix-run/architect/dist/server.js:37:19)",
" at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1147:29)"
]
}
Application should be deployed and display output at the endpoint from the production deploy.
Error at the production url:
{"message":"Internal Server Error"}
Error in cloudwatch logs:
2023-09-23T20:08:57.792Z da801d89-8960-42c2-b45e-c3f84c59da2a ERROR Invoke Error {
"errorType": "ReferenceError",
"errorMessage": "Request is not defined",
"stack": [
"ReferenceError: Request is not defined",
" at createRemixRequest (/var/task/node_modules/@remix-run/architect/dist/server.js:53:3)",
" at Runtime.handler (/var/task/node_modules/@remix-run/architect/dist/server.js:37:19)",
" at Runtime.handleOnceNonStreaming (file:///var/runtime/index.mjs:1147:29)"
]
}
Yes
$ npx create-remix@latest --template remix-run/grunge-stack
remix v2.12.0 πΏ Let's build a better website...
dir Where should we create your new project?
./grunge-stack
βΌ Template: Using remix-run/grunge-stack...
β Template copied
git Initialize a new git repository?
Yes
deps Install dependencies with npm?
Yes
init This template has a remix.init script. Do you want to run it?
Yes
β Dependencies installed
β Git initialized
β Dependencies for remix.init script installed
βΌ Running template's remix.init script...
$ cd ./grunge-stack
$ mv .env.example .env
$ npm run dev
Sign Up will redirect to http://localhost:3333/,%20/
Log In will redirect to http://localhost:3333/notes,%20/notes
I can replicate this in both Windows (Git Bash) and macOS (Silicon).
Using the existing version template npx [email protected] --template remix-run/grunge-stack
results in the same issue, as it upgrades all the dependencies to 2.12.0
and beyond.
In this scenario, I manually changed the package.json file versions from ^2.11.0
to 2.11.0
and installed via npm install --legacy-peer-deps
, but the result was the same, even though the lock file still contains Remix 2.11.0 dependencies and an older version of @remix-run/router
(1.19.0).
I tried with Node 18 and 20.
So, Iβm not entirely sure of the root cause.
This is only a local development issue; I deployed to staging, and itβs not an issue there. However, Iβve refrained from deploying to production.
Sign Up will redirect to http://localhost:3333/
Log In will redirect to http://localhost:3333/notes
Sign Up will redirect to http://localhost:3333/,%20/
Log In will redirect to http://localhost:3333/notes,%20/notes
Yes
run arc deploy --staging --prune
I am expecting this to work
After deploying the app to AWS.
The lambda gives this error:
"errorType": "Error",
"errorMessage": "@prisma/client did not initialize yet. Please run \"prisma generate\" and try to import it again.\nIn case this error is unexpected for you, please report it in https://github.com/prisma/prisma/issues",
"stack": [
"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/issues",
" at new PrismaClient (/var/task/node_modules/.prisma/client/index.js:43:11)",
" at Object.<anonymous> (/var/app/database/db.server.ts:21:21)",
" at Module._compile (node:internal/modules/cjs/loader:1198:14)",
" at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)",
" at Module.load (node:internal/modules/cjs/loader:1076:32)",
" at Function.Module._load (node:internal/modules/cjs/loader:911:12)",
" at Module.require (node:internal/modules/cjs/loader:1100:19)",
" at require (node:internal/modules/cjs/helpers:108:18)",
" at _tryRequireFile (file:///var/runtime/index.mjs:976:37)",
" at _tryRequire (file:///var/runtime/index.mjs:1026:25)"
]
server/node_modules/.prisma/client/index.js
Looks like this file is not updated.
Not sure if I'm doing something wrong but when I run npm run dev
I see that the mocks are being started and loaded with this log console.info("πΆ Mock server running");
However, if I change onUnhandledRequest to "error" like this server.listen({ onUnhandledRequest: "error" });
I never see any errors or logs about unhandled requests even though I'm definitely making requests to Stripe.
I've tried all sorts of things to debug but can't make progress.
Any ideas?
edit: seems like the sanbox is likely starting separate node processes to run the lambdas which MSW won't see.
yes
grunge-stack
template by running npx create-remix --template remix-run/grunge-stack
npx run validate
====================================================================================================
(Run Starting)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cypress: 10.3.0 β
β Browser: Electron 100 (headless) β
β Node Version: v14.19.3 (/<redacted>/.nvm/versions/node/v14.19.3/bin/node) β
β Specs: 1 found (smoke.cy.ts) β
β Searched: cypress/e2e/**/*.cy.{js,jsx,ts,tsx} β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Running: smoke.cy.ts (1 of 1)
smoke tests
1) should allow you to register and login
2) should allow you to make a note
0 passing (3s)
2 failing
1) smoke tests
should allow you to register and login:
Error: The following error originated from your application code, not from Cypress.
> Hydration failed because the initial UI does not match what was rendered on the server.
When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
https://on.cypress.io/uncaught-exception-from-application
at throwOnHydrationMismatch (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:8993:17)
at tryToClaimNextHydratableInstance (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:9014:15)
at updateHostComponent (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:14184:13)
at beginWork (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:15256:22)
at HTMLUnknownElement.callCallback2 (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:3458:22)
at Object.invokeGuardedCallbackDev (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:3483:24)
at invokeGuardedCallback (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:3517:39)
at beginWork$1 (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:19039:15)
at performUnitOfWork (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:18475:20)
at workLoopSync (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:18411:13)
2) smoke tests
should allow you to make a note:
Error: The following error originated from your application code, not from Cypress.
> Hydration failed because the initial UI does not match what was rendered on the server.
When Cypress detects uncaught errors originating from your application it will automatically fail the current test.
This behavior is configurable, and you can choose to turn this off by listening to the `uncaught:exception` event.
https://on.cypress.io/uncaught-exception-from-application
at throwOnHydrationMismatch (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:8993:17)
at tryToClaimNextHydratableInstance (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:9014:15)
at updateHostComponent (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:14184:13)
at beginWork (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:15256:22)
at HTMLUnknownElement.callCallback2 (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:3458:22)
at Object.invokeGuardedCallbackDev (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:3483:24)
at invokeGuardedCallback (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:3517:39)
at beginWork$1 (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:19039:15)
at performUnitOfWork (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:18475:20)
at workLoopSync (http://localhost:8811/_static/build/entry.client-TUK4SINB.js:18411:13)
The cypress smoke tests should pass out of the box on a newly created project using the grunge-stack template
The cypress smoke tests fail out of the box
Hi, I'm really excited about Stacks
But I tried to deploy the grunge Stack as it says in the README itself and after installing the tests idoesn't pass.
Tests that not pass
1) should allow you to register and login
2) should allow you to make a note
Gist with the errors
https://gist.github.com/JoaoGomes5/7cfa976ae9672ab5e7bd4c255ec7677a
I followed the tutorial video and it gives me an error right at the beginning, I don't understand why.
I already tried to create new projects and all of them did not pass the tests.
Thanks and have a great day!
Since we are not requiring the mocks in dev.js
anymore, is this file still needed?
Couldn't we just start the sandbox using arc sandbox directly?
Yes
npx create-remix --template remix-run/grunge-stack
Where would you like to create your app? remix-blog
Do you want me to run npm install
? (Y/n) Y
TypeScript or JavaScript? JavaScript
Do you want to run the build/tests/etc to verify things are setup properly? Yes
error TS5083: Cannot read file '/Users/Siarhei_Liubimau/Documents/remix/remix-blog/tsconfig.json'.
The template should work out of the box.
The template is broken and unusable.
yes
(1) Run npx create-remix@latest --template remix-run/grunge-stack
today
(2) npm run dev
(which runs remix dev --manual -c "arc sandbox -e testing"
)
(3) Sign up with an email and password from the home page.
(4) view and add notes using the notes app
(5) observe the speed of page loads for the notes app and generally
All routes should be "fast" especially since it is using a local sandbox and is a demo app to get people started.
The notes routes and the sign up route feel sluggish, here's my network tab:
I added some console timings around some things, one thing I'm seeing is in app/models/note.server.ts
export async function getNoteListItems({
userId,
}: Pick<Note, "userId">): Promise<Array<Pick<Note, "id" | "title">>> {
console.time("all");
console.time("arc.tables");
const db = await arc.tables();
console.timeEnd("arc.tables");
console.time("db.note.query");
const result = await db.note.query({
KeyConditionExpression: "pk = :pk",
ExpressionAttributeValues: { ":pk": userId },
});
console.timeEnd("db.note.query");
console.timeEnd("all");
return result.Items.map((n: any) => ({
title: n.title,
id: skToId(n.sk),
}));
}
arc.tables
timing is about 1.3s
db.note.query
timing is about 0.9s
all
timing is about 2.23s
Curious if anyone else can replicate it. I guess I can't rule out something weird with my network. I do have a vpn for work but I tried with it turned off as well.
I'm getting the following error when running npm run validate
Steps to reproduce:
npx create-remix --template remix-run/grunge-stack
cd <your-app-name>
npm run validate
Extra info:
Also, I noticed this warning in the installation step:
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
(which is expected because I have npm v6)
Looks like the error doesn't block the development server so I can live with it but I thought it would be good to report it so you guys can be aware of it.
Error: expected <NPM script name that starts server> <url or port> <NPM script name that runs tests>
example: start-test start 8080 test
see https://github.com/bahmutov/start-server-and-test#use
at lazyAssLogic (D:\frontend-projects\experiments\my-remix-app\node_modules\lazy-ass\index.js:110:14)
at lazyAss (D:\frontend-projects\experiments\my-remix-app\node_modules\lazy-ass\index.js:115:28)
at Object.getArguments (D:\frontend-projects\experiments\my-remix-app\node_modules\start-server-and-test\src\utils.js:91:5)
at Object.<anonymous> (D:\frontend-projects\experiments\my-remix-app\node_modules\start-server-and-test\src\bin\start.js:10:22)
at Module._compile (internal/modules/cjs/loader.js:1085:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
at Module.load (internal/modules/cjs/loader.js:950:32)
at Function.Module._load (internal/modules/cjs/loader.js:790:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-remix-app-87b1@ test:e2e:run: `cross-env PORT=8811 start-server-and-test dev http://localhost:8811 'cypress run'`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-remix-app-87b1@ test:e2e:run script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Yes
Loading notes takes 30ms (like it does in Indie stack)
Loading notes takes 800-900ms
Yes
npx create-remix@latest
npm run dev
after the install script finishesThe page should reload and reflect the file changes.
The page does not refresh automatically. A manual refresh shows the changes, indicating that the build was successful.
Yes
The Remix documentation indicates that projects should migrate to Remix Vite. It would be helpful if this template could be updated to support the new Remix Vite compiler. I thought I'd open an issue to track this.
@gustavorino Indicated they'd consider updating it here: #185 (comment)
N/A
N/A
yes
1./ Open PowerShell
2./ Run npx create-remix@latest
3./ Select options as the image below
The cli should proceed to the next step after I type 'N' and hit enter for Do you want to run the build/tests/etc to verify things are setup properly?
The cli freezed
Hello! I did a deep dive into this stack tonight and have found an issue that I would like to get your thoughts on. It appears when Architect deploys the static assets, it does it in alphabetical order (or maybe random?). As you can guess, if we upload root first and a User goes to the app, they will get unexpected results since all the assets are not fully published. I have recreated this very easily by changing a few different files and adding new tailwind css classes so it will regen the .css file. I don't think this is a technical issue with Remix but I wanted to bring this up and offer to help drive a solution. Off the top of my head, I think the solution is uploading all of the assets except for the root file, leaving that last. I did some api doc searches in Architect, but I could not find a config that would allow us to affect the static asset upload process.
Great job on all of the work Remix has done so far!
yep
Follow the README and add:
afterEach(() => {
cy.cleanupUser();
});
to the Cypress test file (smoke.cy.ts
). Run Cypress tests.
Tests succeed and test users are deleted from db.
Tests fail with TypeError: cy.cleanupUser is not a function
the Architect folks released architect v10 and functions v5 last week, we should bump functions to v5 and also remove @architect/architect
from our dependencies after we release remix 1.2.3(?) as it has a couple of fixes for both of those
1.6.2
npx create-remix@latest
, choose grunge (arc)Expect the verification (npm run validate) to pass on the baseline install.
The import
import { installGlobals } from "@remix-run/node/globals";
Doesn't exist. Has to be "@remix-run/node"
The import "@remix-run/dev/server-build" doesn't exist. The build variable probably has to be require("./server")
Not sure if one should rerun npx remix init
if it fails, but rerunning the command (after failing) complains about missing files in .github
folder.
Finally, continue to run npx remix init
or npm run validate
throws these:
Rebuilding...
Done in 126ms.
App β remix-arc-e479
Region β us-west-2
Profile β hongyew
Version β Architect 10.3.3
cwd β /Users/hongyew/Projects/experiments/remix-arc
β Sandbox Found Architect project manifest: app.arc
β Sandbox Found testing environment variables: .env
β Sandbox Using testing live AWS infra: @tables
β Sandbox Started AWS service emulator
β Sandbox @tables created in local database
β Sandbox @http server started
β Sandbox Project files hydrated into functions
β Sandbox Available @http (HTTP API mode / Lambda proxy v2.0 format) routes
any /* ................................ server
http://localhost:8811
β Sandbox Started in 67ms
β€οΈ Local environment ready!
β Sandbox Started file watcher
πΏ Built in 273ms
/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/routes.js:18
return Object.entries(manifest).filter(([, route]) => route.parentId === parentId).map(([id, route]) => ({ ...route,
^
/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/routes.js:18
return Object.entries(manifest).filter(([, route]) => route.parentId === parentId).map(([id, route]) => ({ ...route,
^
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at Object.createRoutes (/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/routes.js:18:17)
at Object.createRequestHandler (/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/server.js:26:25)
at createRequestHandler (/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/architect/dist/server.js:35:28)
at server.ts (/Users/hongyew/Projects/experiments/remix-arc/server.ts:8:24)
at /Users/hongyew/Projects/experiments/remix-arc/server/index.js:8:56
at Object.<anonymous> (/Users/hongyew/Projects/experiments/remix-arc/server/index.js:57:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/routes.js:18
return Object.entries(manifest).filter(([, route]) => route.parentId === parentId).map(([id, route]) => ({ ...route,
^
/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/routes.js:18
return Object.entries(manifest).filter(([, route]) => route.parentId === parentId).map(([id, route]) => ({ ...route,
^
TypeError: Cannot convert undefined or null to object
at Function.entries (<anonymous>)
at Object.createRoutes (/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/routes.js:18:17)
at Object.createRequestHandler (/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/server-runtime/dist/server.js:26:25)
at createRequestHandler (/Users/hongyew/Projects/experiments/remix-arc/node_modules/@remix-run/architect/dist/server.js:35:28)
at server.ts (/Users/hongyew/Projects/experiments/remix-arc/server.ts:8:24)
at /Users/hongyew/Projects/experiments/remix-arc/server/index.js:8:56
at Object.<anonymous> (/Users/hongyew/Projects/experiments/remix-arc/server/index.js:57:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
yes
Create a folder on a windows drive from within WSL and setup project there
mkdir /mnt/c/dev
cd dev
npx create-remix --template remix-run/grunge-stack
-- or --
npm run validate
Result:
β Sandbox Started file watcher
Watching Remix app in development mode...
β οΈ Test routes enabled.
β οΈ Warning: mnt/c/dev/chess2/server timed out after hitting its 5s timeout!
β οΈ Warning: mnt/c/dev/chess2/server timed out after hitting its 5s timeout!
β οΈ Warning: mnt/c/dev/chess2/server timed out after hitting its 5s timeout!
β οΈ Warning: mnt/c/dev/chess2/server timed out after hitting its 5s timeout!
...
If the project is created in a linux folder (e.g. ~/dev/) it works just fine.
Tests run through
β οΈ Warning: mnt/c/dev/chess2/server timed out after hitting its 5s timeout!
is repeated forever
yes
I tried very hard to get remix' defer function working as expected - meaning promises shall not block page generation but are streamed to the client later.
However - using the grunge stack I was not able to make the most simple setup running. Instead I always see the server blocking the HTML response until the promise handed over to defer is resolved. Example page:
import { Await, useLoaderData } from "@remix-run/react";
import { Suspense } from "react";
export async function loader() {
const load = function () {
return new Promise((resolve) => {
setTimeout(() => resolve({ items: [], categories: [] }), 3000);
});
};
return defer({
conversionChartPromise: load(),
});
}
export default function Dashboard() {
const data = useLoaderData<typeof loader>();
console.log(data.conversionChartPromise);
return (
<Suspense fallback={<div>Loading</div>}>
<Await
resolve={data.conversionChartPromise}
errorElement={<p>Error loading package location!</p>}
>
{(conversionChart) => {
console.log(conversionChart);
return null;
}}
</Await>
</Suspense>
);
}
The page should be rendered immediately - after the promise resolved the data should be streamed to the client.
Page generation always blocks for three seconds until promise is resolved. No streaming is happening.
1.5.1
success
missing SESSION_SECRET error in lambda function
error occurs in line 7 of session.server.ts: invariant(process.env.SESSION_SECRET, "SESSION_SECRET must be set");
Note that this will be fixed if the .arc file has an @aws section
Example:
@aws
region us-east-2
profile default
With that entry in the .arc file, it would be clear to a user what needs to be changed (i.e. change default to the desired profile)
Documentation could be amended to suggest that is where to change the region and profile if needed.
Yes
Just setup a new project, create an account and login, then hit '/logout'
When I get back to the home page I'm still signed in ...
I did not spend a ton of time trying to figure out the root cause but nothing I did in the session.server.ts
file seemed to have any effects. I suspect something else is setting/committing the session back in?
For now I just updated the logout.tsx
loader which I think is called out as something you should not do in the docs
(?? Sorry I have only started using remix a few weeks ago).
export const loader = async ({ request }: LoaderFunctionArgs) => {
const session = await getSession(request);
return redirect("/", {
headers: {
"Set-Cookie": await sessionStorage.destroySession(session),
},
});
};
When I hit the /logout
route, the session is destroyed and I'm redirected to the homepage where I see a login and a signup button.
I'm redirected to the homepage where I see the "View notes" button.
I also cannot navigate to the login page.
This is no longer required and I'd love to not see new projects start off using this legacy approach. AWS + Github can auth through OIDC
Article explaining what I'm talking about:
https://awsteele.com/blog/2021/09/15/aws-federation-comes-to-github-actions.html
Example cfn
Parameters:
FullRepoName:
Type: String
Default: <full-repo-name>
Resources:
Role:
Type: 'AWS::IAM::Role'
Properties:
RoleName: github
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/AdministratorAccess'
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Action: 'sts:AssumeRoleWithWebIdentity'
Principal:
Federated: !Ref GithubOidc
Condition:
StringLike:
'token.actions.githubusercontent.com:sub': !Sub 'repo:${FullRepoName}:*'
GithubOidc:
Type: 'AWS::IAM::OIDCProvider'
Properties:
Url: 'https://token.actions.githubusercontent.com'
ThumbprintList:
- 6938fd4d98bab03faadb97b34396831e3780aea1
ClientIdList:
- "sts.amazonaws.com"
Outputs:
Role:
Value: !GetAtt Role.Arn
Example step in github
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
role-to-assume: <role>
aws-region: us-east-1
yes
Deploy new application on aws with github actions.
Deploy with Success
Run arc deploy --production --prune
arc deploy --production --prune
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
npm_config_cache: /home/runner/.npm
CI: true
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY: ***
App β remix-aws-451b
Region β us-west-[2](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:2)
Profile β Set via environment
Version β Architect 10.4.0
cwd β /home/runner/work/remix-run-aws/remix-run-aws
β¬ Hydrate Finding dependencies
β¬ Hydrate Hydrating dependencies in 1 path
β¬ Hydrate Hydrating server/
β Hydrate Hydrated server/
| npm i --production: added 97 packages from 165 contributors and audited 98 packages in [3](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:3).92[4](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:4)s
| npm i --production: 41 packages are looking for funding
| npm i --production: run `npm fund` for details
| npm i --production: found 0 vulnerabilities
| npm i --production: npm notice created a lockfile as package-lock.json. You should commit this file.
β Hydrate Successfully hydrated dependencies
β¬ Deploy This Lambda should ideally be under [5](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:5)MB for optimal performance:
| server (29,535KB)
β¬ Deploy Creating new private deployment bucket: ****
β¬ Deploy Initializing deployment
| Stack ... RemixAws451bProduction
| Bucket .. ****
β¬ Deploy Created deployment templates
β¬ Deploy Generating CloudFormation deployment...
β Deploy Generated CloudFormation deployment
β¬ Deploy Deploying & building infrastructure...
deploy failed!
Uploading to 8eb4[6](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:6)d[7](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:7)e0bc6041699a44022[8](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:8)4d7df[9](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:10)d.template 8892 / 8892.0 ([10](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:11)0.00%)
Waiting for changeset to be created..
Waiting for stack create/update to complete
Failed to create/update the stack. Run the following command
to fetch the list of events leading up to the failure
aws cloudformation describe-stack-events --stack-name RemixAws451bProduction
Error:
Uploading to 8eb46d7e0bc6041699a4402284d7df9d.template 8892 / 8892.0 (100.00%)
Waiting for changeset to be created..
Waiting for stack create/update to complete
Failed to create/update the stack. Run the following command
to fetch the list of events leading up to the failure
aws cloudformation describe-stack-events --stack-name RemixAws451bProduction
at ChildProcess.<anonymous> (/opt/hostedtoolcache/node/14.20.0/x64/lib/node_modules/@architect/architect/node_modules/@architect/deploy/src/sam/utils/spawn.js:23:16)
at ChildProcess.emit (events.js:400:28)
at ChildProcess.emit (domain.js:475:[12](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:13))
at maybeClose (internal/child_process.js:1088:[16](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:17))
at Process.ChildProcess._handle.onexit (internal/child_process.js:[29](https://github.com/robsonkades/remix-run-aws/runs/7683794292?check_suite_focus=true#step:10:30)6:5)
Error: Process completed with exit code 1.
yes
Steps
Reference
remix.config.js
assetsBuildDirectory: "public/build", publicPath: "/_static/build/", serverBuildTarget: "arc", server: "./server.ts",
π€ Deployment works, but I'm not seeing the app at the expected URL.
The result is a 404 on every route.
- Code: NoSuchKey
- Message: The specified key does not exist.
- Key: index.html
- RequestId: 164GEDTF7M8N85P2
- HostId: eG7ra0vK8XxFS9FrsYCCttfYBIdIyD0NywlVaKaVmrKmxDyBWXAO7SQW91VIuDUzsBxnn7AVdwo=
- Code: NoSuchKey
- Message: The specified key does not exist.
- Key: 404.html
yes
β― npx create-remix --template remix-run/grunge-stack
either select the validate option
-- or --
β― npm run validate
server.ts:9:3 - error TS2739: Type 'typeof import("/Users/jtushman/code/remix-playground/notes/node_modules/@remix-run/dev/server-build")' is missing the following properties from type 'ServerBuild': publicPath, assetsBuildDirectory
9 build,
~~~~~
node_modules/@remix-run/architect/dist/server.d.ts:18:5
18 build: ServerBuild;
~~~~~
The expected type comes from property 'build' which is declared here on type '{ build: ServerBuild; getLoadContext?: GetLoadContextFunction | undefined; mode?: string | undefined; }'
I'd expect the initial clean pull to validate
we are getting a type error
Yes
npx create-remix@latest --template remix-run/grunge-stack
npm run test:e2e:dev
Then go to Cypress and run the smoke test.
All the test should pass
Cypress's custom commands cannot be recognized:
Type Error: cy.visitAndCheck is not a function
Type Error: cy.login is not a function
I'm having the same problem with the Indie Stack
Yes
As the software evolves, the stack should be such that is could be updated to latest version. To this end, I suggest that grunge-stack is updated to latest versions.
I have tried this manually and was able to fix a few errors:
@smithy/node-http-handler
, @aws-sdk/lib-dynamodb
, and @aws-sdk/client-dynamodb
)isbot
should be retained at the version 3.8.0
due to breaking changes in the version 4.0.0
remix.config.js
must be added the following configuration: browserNodeBuiltinsPolyfill: { modules: { querystring: true } }
Finally there is also an error related to cypress tests. The tests fail with:
Lambda init error: The requested module 'msw' does not provide an export named 'rest'
http://localhost:8811 timed out on retry 9 of 3, elapsed 95619ms, limit 90000ms
Error: Response code 500 (Internal Server Error)
I'm at lost here and really do not know what to do with this. If someone can help with this one, I could make pull request. Or maybe the Remix team would like to update the stack..
N/A
N/A
Yes
npx create-remix@latest --template remix-run/grunge-stack
npm i
npx remix init
It should work.
Error: Command failed: npm install
at checkExecSyncError (node:child_process:890:11)
at Object.execSync (node:child_process:962:15)
at Object.init (/Users/tgdn/workspace/admin/node_modules/@remix-run/dev/dist/cli/commands.js:96:24)
at async Object.run (/Users/tgdn/workspace/admin/node_modules/@remix-run/dev/dist/cli/run.js:240:7) {
status: 1,
signal: null,
output: [ null, null, null ],
pid: 66524,
stdout: null,
stderr: null
}
yes
npx create-remix my-app --template remix-run/grunge-stack
cd my-app
pnpm dev
On windows, pressing CTRL+C should kill all the processes of the "dev" npm script.
On windows, pressing CTRL+C DOESN'T kill all the processes of the "dev" npm script.
It works if I replace the run-p
with npm-run-all -p
Yes
Run npx create-remix@latest --template remix-run/grunge-stack
on Windows 11 with a valid project name, answering yes to all the prompts (automatic initialization of Git repo, automatic installation of npm dependencies, automatic execution of remix.init, automatic execution of "build/tests/etc").
Successful, error-free installation of grunge-stack.
An error occurs during execution of tests. Relevant portion of output from the procedure follows:
β Sandbox File watcher now looking for project changes
DevTools listening on ws://127.0.0.1:53569/devtools/browser/374535f8-f14d-4629-b03f-ef43b0fce540
(node:14772) ExperimentalWarning: Custom ESM Loaders is an experimental feature and might change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
====================================================================================================
(Run Starting)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Cypress: 12.17.3 β
β Browser: Electron 106 (headless) β
β Node Version: v20.7.0 (C:\Program Files\nodejs\node.exe) β
β Specs: 1 found (smoke.cy.ts) β
β Searched: cypress/e2e/**/*.cy.{js,jsx,ts,tsx} β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Running: smoke.cy.ts (1 of 1)
smoke tests
[REMIX DEV] 3F852232 ready
1) should allow you to register and login
[REMIX DEV] 3F852232 ready
! Warning: [eb94b313-cb38-445c-889b-0b56c11cc948] Timed out after hitting its 5s timeout!
! Warning: [4144f8e2-8ab5-4bf0-8b00-cadfeb503d9f] Timed out after hitting its 5s timeout!
2) should allow you to make a note
0 passing (15s)
2 failing
1) smoke tests
should allow you to register and login:
AssertionError: Timed out retrying after 4000ms: Unable to find an accessible element with the role "link" and name `/notes/i`
Here are the accessible roles:
document:
Name "":
<body
class="h-full"
/>
--------------------------------------------------
textbox:
Name "Email address":
<input
aria-describedby="email-error"
autocomplete="email"
class="w-full rounded border border-gray-500 px-2 py-1 text-lg"
id="email"
name="email"
required=""
type="email"
/>
--------------------------------------------------
button:
Name "Create Account":
<button
class="w-full rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600 focus:bg-blue-400"
type="submit"
/>
--------------------------------------------------
link:
Name "Log in":
<a
class="text-blue-500 underline"
href="/login"
/>
--------------------------------------------------
Ignored nodes: comments, script, style
<html
class="h-full"
lang="en"
>
<head>
<meta
charset="utf-8"
/>
<meta
content="width=device-width,initial-scale=1"
name="viewport"
/>
<link
href="/_static/favicon.ico"
rel="icon"
/>
<title>
Sign Up
</title>
<link
href="/_static/build/_assets/tailwind-TTAZ2KQD.css"
rel="stylesheet"
/>
</head>
<body
class="h-full"
>
<div
class="flex min-h-full flex-col justify-center"
>
<div
class="mx-auto w-full max-w-md px-8"
>
<form
action="/join"
class="space-y-6"
method="post"
>
<div>
<label
class="block text-sm font-medium text-gray-700"
for="email"
>
Email address
</label>
<div
class="mt-1"
>
<input
aria-describedby="email-error"
autocomplete="email"
class="w-full rounded border border-gray-500 px-2 py-1 text-lg"
id="email"
name="email"
required=""
type="email"
/>
</div>
</div>
<div>
<label
class="block text-sm font-medium text-gray-700"
for="password"
>
Password
</label>
<div
class="mt-1"
>
<input
aria-describedby="password-error"
autocomplete="new-password"
class="w-full rounded border border-gray-500 px-2 py-1 text-lg"
id="password"
name="password"
type="password"
/>
</div>
</div>
<input
name="redirectTo"
type="hidden"
value=""
/>
<button
class="w-full rounded bg-blue-500 px-4 py-2 text-white hover:bg-blue-600 focus:bg-blue-400"
type="submit"
>
Create Account
</button>
<div
class="flex items-center justify-center"
>
<div
class="text-center text-sm text-gray-500"
>
Already have an account?
<a
class="text-blue-500 underline"
href="/login"
>
Log in
</a>
</div>
</div>
</form>
</div>
</div>
</body>
</html>
at Context.eval (webpack:///./cypress/e2e/smoke.cy.ts:14:0)
2) smoke tests
should allow you to make a note:
CypressError: `cy.request()` failed on:
http://localhost:8811/__tests/create-user
The response we received from your web server was:
> 500: Internal Server Error
This was considered a failure because the status code was not `2xx` or `3xx`.
If you do not want status codes to cause failures pass the option: `failOnStatusCode: false`
-----------------------------------------------------------
The request we sent was:
Method: POST
URL: http://localhost:8811/__tests/create-user
Headers: {
"Connection": "keep-alive",
"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Cypress/12.17.3 Chrome/106.0.5249.51 Electron/21.0.0 Safari/537.36",
"accept": "*/*",
"accept-encoding": "gzip, deflate",
"content-type": "application/json",
"content-length": 32
}
Body: {"email":"[email protected]"}
-----------------------------------------------------------
The response we got was:
Status: 500 - Internal Server Error
Headers: {
"content-type": "text/html; charset=utf8;",
"cache-control": "no-cache, no-store, must-revalidate, max-age=0, s-maxage=0",
"date": "Wed, 27 Sep 2023 06:35:47 GMT",
"connection": "keep-alive",
"keep-alive": "timeout=5",
"content-length": "1371"
}
Body: <head>
<style>
body {
font-family: sans-serif;
}
code, pre {
font-family: monospace;
color: #00c26e;
}
</style>
<script>
(() => {
const url = 'ws://localhost:2223'
let socket = new WebSocket(url)
socket.addEventListener('message', message => {
if (message.data === 'reload') location.reload()
})
socket.addEventListener('close', ({ wasClean }) => {
const retryMs = 1000
const cancelMs = 5000
const maxAttempts = Math.round(cancelMs / retryMs)
let attempts = 0
const reloadIfCanConnect = () => {
attempts++
if (attempts > maxAttempts){
console.error('Could not reconnect to dev server.')
return
}
socket = new WebSocket(url)
socket.addEventListener('error', () => {
setTimeout(reloadIfCanConnect, retryMs)
})
socket.addEventListener('open', () => {
if (!wasClean) {
location.reload()
}
})
}
reloadIfCanConnect()
})
})();
</script>
</head>
<h1>Lambda error</h1>
<h2>Error: Timeout error: <p>Lambda timed out after <b>5 seconds</b></p></h2>
<h3>Lambda: <code>@http any /*</code></h3>
<h3>Source: <code>C:\[path-to-project]\server</code></h3>
<p>: <p>Lambda timed out after <b>5 seconds</b></p></p>
<p>(No stack trace)</p>
https://on.cypress.io/request
at <unknown> (http://localhost:8811/__cypress/runner/cypress_runner.js:149327:80)
at tryCatcher (http://localhost:8811/__cypress/runner/cypress_runner.js:18744:23)
at Promise._settlePromiseFromHandler (http://localhost:8811/__cypress/runner/cypress_runner.js:16679:31)
at Promise._settlePromise (http://localhost:8811/__cypress/runner/cypress_runner.js:16736:18)
at Promise._settlePromise0 (http://localhost:8811/__cypress/runner/cypress_runner.js:16781:10)
at Promise._settlePromises (http://localhost:8811/__cypress/runner/cypress_runner.js:16861:18)
at _drainQueueStep (http://localhost:8811/__cypress/runner/cypress_runner.js:13451:12)
at _drainQueue (http://localhost:8811/__cypress/runner/cypress_runner.js:13444:9)
at ../../node_modules/bluebird/js/release/async.js.Async._drainQueues (http://localhost:8811/__cypress/runner/cypress_runner.js:13460:5)
at Async.drainQueues (http://localhost:8811/__cypress/runner/cypress_runner.js:13330:14)
From Your Spec Code:
at Context.login (webpack:///./cypress/support/commands.ts:4:0)
[REMIX DEV] 3F852232 ready
(Results)
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Tests: 2 β
β Passing: 0 β
β Failing: 2 β
β Pending: 0 β
β Skipped: 0 β
β Screenshots: 2 β
β Video: true β
β Duration: 15 seconds β
β Spec Ran: smoke.cy.ts β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
(Screenshots)
- C:\[path-to-project]\cypress\screenshots\smoke.cy.t (1280x720)
s\smoke tests -- should allow you to register and login (failed).png
- C:\[path-to-project]\cypress\screenshots\smoke.cy.t (1280x720)
s\smoke tests -- should allow you to make a note (failed).png
(Video)
- Started compressing: Compressing to 32 CRF
[REMIX DEV] 3F852232 ready
- Finished compressing: 1 second
- Video output: C:\[path-to-project]\cypress\videos\smoke.cy.ts.mp4
====================================================================================================
(Run Finished)
Spec Tests Passing Failing Pending Skipped
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Γ smoke.cy.ts 00:15 2 - 2 - - β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Γ 1 of 1 failed (100%) 00:15 2 - 2 - -
[REMIX DEV] 3F852232 ready
Error: Command failed with exit code 2: npx cypress run
at makeError (C:\[path-to-project]\node_modules\execa\lib\error.js:60:11)
at handlePromise (C:\[path-to-project]\node_modules\execa\index.js:118:26)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5) {
shortMessage: 'Command failed with exit code 2: npx cypress run',
command: 'npx cypress run',
escapedCommand: '"npx cypress run"',
exitCode: 2,
signal: undefined,
signalDescription: undefined,
stdout: undefined,
stderr: undefined,
failed: true,
timedOut: false,
isCanceled: false,
killed: false
}
ERROR: "test:e2e:run" exited with 1.
β² Oh no! Template's remix.init script failed
yes
Deploy the template to AWS using the arc deployment
Attempt to sign up
Expect a 500 internal server error
Sign up should succeed
There is an internal server error with no logging at the time bycryptjs attempts to hash the password.
I added a try catch, still no error. So at that point I assumed this is a very low level issue.
Indeed, I added more memory to the aws lambda deployment to 1024 MB from the default 128 MB and hashing did not fail, I was able to log in.
I would suggest that the declaration:
memory 1024
Is added to the lambda, potentially 512 could fix the issue. I was not able to determine if it was due to CPU or RAM and both scale on memory within lambda
1.5.1
npx create-remix
gave it a name
chose "a pre-configured stack ready for prod..."
chose "Grunge" stack
chose "Typescript"
do you want me to run npm install? no
cd into new project directory
yarn
yarn dev
visit localhost:3000
see error
"dependencies": {
"@architect/architect": "^10.3.3",
"@architect/functions": "^5.1.0",
"@remix-run/architect": "^1.5.1",
"@remix-run/node": "^1.5.1",
"@remix-run/react": "^1.5.1",
"@remix-run/server-runtime": "^1.5.1",
"bcryptjs": "2.4.3",
"cuid": "^2.1.8",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"tiny-invariant": "^1.2.0"
run dev should load the initial page
getting this error:
Error
Process exited with 1
/home/user/MyProjects/remix-samples-rn/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:14
throw new Error(value);
^
/home/user/MyProjects/remix-samples-rn/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:14
throw new Error(value);
^
Error: Invariant failed: SESSION_SECRET must be set
at invariant (/home/user/MyProjects/remix-samples-rn/node_modules/tiny-invariant/dist/tiny-invariant.cjs.js:14:11)
at Object. (/home/user/MyProjects/remix-samples-rn/app/session.server.ts:7:1)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Module.require (node:internal/modules/cjs/loader:1013:19)
at require (node:internal/modules/cjs/helpers:93:18)
at [eval]:1:336
at Script.runInThisContext (node:vm:131:12)
Yes
npx create-remix@latest --template remix-run/grunge-stack
Dependencies installing with npm...
β² Oh no! Failed to install dependencies.
The above happened repeatedly in different directories
Whilst troubleshooting I installed a fresh remix@latest app, without the grunge template and the install including the dependencies completed without error.
complete install and config steps
install fails on npm dependency install
I'm not sure what happened, but suddenly the cy.login()
functionality stopped working. Here's the last successful build: https://github.com/remix-run/grunge-stack/actions/runs/1994316486 Could be #10, or #11 (or maybe something completely unrelated π)
Yes
Run npx create-remix --template remix-run/grunge-stack
(say Yes to everything)
Then run npm run validate
, and you will see:
TypeError: interceptors.createInterceptor is not a function
at setupServer (/Users/usr/src/my-remix-app/node_modules/msw/node/lib/index.js:8143:42)
at mocks/index.js (/Users/usr/src/my-remix-app/mocks/index.js:3:16)
at __require (/Users/usr/src/my-remix-app/server/index.js:12:50)
at Object.<anonymous> (/Users/usr/src/my-remix-app/server.ts:5:3)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
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)
Or, run npm run dev
and go to http://localhost:3000
and you will see the same error
The template should work out of the box
The template is broken and unusable
Yes
Redirect to the sign-in screen.
Infinite loop because of 401 Unauthorized
This stack works very nicely and is a huge step forward. I do note that the deployed lambda is pretty large (7MB zip) and it's because it contains the entire node_modules
directory (unpacked 29MB).
It would be really nice for server.js
to be in TypeScript and to integrate esbuild into the Arc deploy process, not just the app compilation step, so only the needed code is deployed.
Yes
npx create-remix@latest --template remix-run/grunge-stack
A working project.
Here's the default installation:
jari@lucille Sources % npx create-remix@latest --template remix-run/grunge-stack
remix v2.6.0 πΏ Let's build a better website...
dir Where should we create your new project?
./my-remix-app
βΌ Template: Using remix-run/grunge-stack...
β Template copied
git Initialize a new git repository?
Yes
deps Install dependencies with npm?
Yes
init This template has a remix.init script. Do you want to run it?
Yes
ββββββ Dependencies installing with npm...
β² Oh no! Failed to install dependencies.
jari@lucille Sources %
If we look deeper, it shows the following error:
jari@lucille Sources % cd my-remix-app
jari@lucille my-remix-app % npm install
npm ERR! code ERESOLVE
[...]
npm ERR! While resolving: @remix-run/[email protected]
npm ERR! Found: [email protected]
[...]
npm ERR! Conflicting peer dependency: [email protected]
[...]
jari@lucille my-remix-app %
yes
$ npx create-remix@latest --template remix-run/grunge-stack
? Where would you like to create your app? ./my-remix-app
? TypeScript or JavaScript? TypeScript
? Do you want me to run `npm install`? Yes
...
failed to load config from /Users/agonzalezjr/code/bluejay/my-remix-app/vitest.config.ts
β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β― Unhandled Error β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―β―
Error: Cannot find module 'node:path'
Require stack:
- /Users/agonzalezjr/code/bluejay/my-remix-app/node_modules/@vitejs/plugin-react/dist/index.cjs
- /Users/agonzalezjr/code/bluejay/my-remix-app/vitest.config.ts
- /Users/agonzalezjr/code/bluejay/my-remix-app/node_modules/vite/dist/node/chunks/dep-d29b4e33.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:885:15)
at Function.Module._load (internal/modules/cjs/loader.js:730:27)
at Module.require (internal/modules/cjs/loader.js:957:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/Users/agonzalezjr/code/bluejay/my-remix-app/node_modules/@vitejs/plugin-react/dist/index.cjs:3:14)
at Module._compile (internal/modules/cjs/loader.js:1068:30)
at Module._extensions..js (internal/modules/cjs/loader.js:1097:10)
at Object._require.extensions.<computed> [as .js] (file:///Users/agonzalezjr/code/bluejay/my-remix-app/node_modules/vite/dist/node/chunks/dep-d29b4e33.js:64030:17)
at Module.load (internal/modules/cjs/loader.js:933:32)
at Function.Module._load (internal/modules/cjs/loader.js:774:14) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/Users/agonzalezjr/code/bluejay/my-remix-app/node_modules/@vitejs/plugin-react/dist/index.cjs',
'/Users/agonzalezjr/code/bluejay/my-remix-app/vitest.config.ts',
'/Users/agonzalezjr/code/bluejay/my-remix-app/node_modules/vite/dist/node/chunks/dep-d29b4e33.js'
]
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-remix-app-2d72@ test: `vitest "--run"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-remix-app-2d72@ test script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/agonzalezjr/.npm/_logs/2022-10-29T19_47_48_046Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-remix-app-2d72@ test:e2e:run: `cross-env PORT=8811 start-server-and-test dev http://localhost:8811 "npx cypress run"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-remix-app-2d72@ test:e2e:run script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/agonzalezjr/.npm/_logs/2022-10-29T19_47_48_168Z-debug.log
ERROR: "test -- --run" exited with 1.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-remix-app-2d72@ validate: `run-p "test -- --run" lint typecheck test:e2e:run`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-remix-app-2d72@ validate script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/agonzalezjr/.npm/_logs/2022-10-29T19_47_48_215Z-debug.log
π¨ Oops, remix.init failed
Command failed: npm run validate
Setup finishes without errors.
Setup fails.
Yes
Relevant info: System is Ubuntu 22.04.2 LTS
Node versions tried 16, and 18
Have also tried a fresh install of all deps with each, and updating outdated dependencies. To no avail.
Interestingly, deployment via npx arc deploy works.
1.) npx create-remix --template your/repo
2.) create git repo
3.) GET AWS credentials and add them as secrets to the repo Actions secrets section
4.) npm run validate / install
5.) npx arc env --add --env (ARC_APP_SECRET) for each of the environments
6.) git init commit then push to repo
7.) Deployments kick off but fail with this error:
Run arc deploy --production -v --prune
arc deploy --production -v --prune
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
AWS_ACCESS_KEY_ID: ***
AWS_SECRET_ACCESS_KEY:
App β benteen-sotg-a0e3
Region β us-west-2
Profile β @aws profile / AWS_PROFILE not configured
Version β Architect 10.13.1
cwd β /home/runner/work/benteen-sotg/benteen-sotg
deploy failed! Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
CredentialsError: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1
at IncomingMessage.<anonymous> (/opt/hostedtoolcache/node/16.20.1/x64/lib/node_modules/@architect/architect/node_modules/aws-sdk/lib/util.js:930:34)
at IncomingMessage.emit (node:events:525:35)
at IncomingMessage.emit (node:domain:489:12)
at endReadableNT (node:internal/streams/readable:1358:12)
at processTicksAndRejections (node:internal/process/task_queues:83:21)
Error: Process completed with exit code 1.
Deployment proceeds as normal / expected via Github Actions.
Interestingly, deployment via npx arc deploy works.
Deployment fails in Github Actions Context.
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.