Skip to content
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(ses errors): Addresses ses and Webpack related errors #2

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion components/common/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
Text,
useColorModeValue,
} from "@interchain-ui/react";
import { dependencies, products, Project } from "@/config";
import { Project, dependencies, products } from "../../config";
// import { dependencies, products, Project } from "@/config";
Comment on lines +10 to +11

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you don't need this change, just do it.
image

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm trying to figure out how to run it in a turborepo, your solution gimme some idea, thanks.


function Product({ name, desc, link }: Project) {
return (
Expand Down
3 changes: 2 additions & 1 deletion components/common/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import {
useColorModeValue,
useTheme,
} from "@interchain-ui/react";
import { dependencies } from "@/config";
import { dependencies } from "../../config";
// import { dependencies } from "@/config";

const stacks = ["CosmosKit", "Next.js"];

Expand Down
3 changes: 2 additions & 1 deletion components/wallet/Wallet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { chains } from 'chain-registry';
import { User } from './User';
import { Chain } from './Chain';
import { Warning } from './Warning';
import { CHAIN_NAME, CHAIN_NAME_STORAGE_KEY } from '@/config';
// import { CHAIN_NAME, CHAIN_NAME_STORAGE_KEY } from '@/config';
import {
ButtonConnect,
ButtonConnected,
Expand All @@ -21,6 +21,7 @@ import {
ButtonNotExist,
ButtonRejected,
} from './Connect';
import { CHAIN_NAME, CHAIN_NAME_STORAGE_KEY } from '../../config';

export type WalletProps = {
chainName?: string;
Expand Down
5 changes: 3 additions & 2 deletions pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { useState } from "react";
import { Layout, Wallet } from "@/components";
import { CHAIN_NAME } from "@/config";
import { CHAIN_NAME } from "../config";
import { Layout, Wallet } from "../components";


export default function Home() {
const [chainName, setChainName] = useState(CHAIN_NAME);
Expand Down
5 changes: 1 addition & 4 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"incremental": true,
"paths": {
"@/*": ["*"]
}
"incremental": true
},
"include": [
"next-env.d.ts",
Expand Down
33 changes: 21 additions & 12 deletions utils/installSesLockdown.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
import 'ses';

const consoleTaming =
process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'test'
? 'unsafe'
: 'safe';

lockdown({
errorTaming: 'unsafe',
overrideTaming: 'severe',
consoleTaming,
});
// execute upon import
(async () => {
await import("ses"); // adds lockdown, harden, and Compartment
const consoleTaming =
process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test"
? "unsafe"
: "safe";

lockdown({
errorTaming: "unsafe",
overrideTaming: "severe",
consoleTaming,
});

Error.stackTraceLimit = Infinity;

})();

export default function initiateLockdown() {
return Promise.resolve();
}