Comments (3)
Here is my current solution.
Add the packages that need to be transpiled in next.config.js:
{
...
transpilePackages: [
...
'@t3-oss/env-nextjs',
'@t3-oss/env-core',
],
}
Due to Jest being unable to parse untranspiled ESM packages, it is necessary to have webpack transpile them first. In Next.js, this can be accomplished by adding transpilePackages to next.config.js
.
from t3-env.
Same issue.
Next.js: v14.2.3,
@t3-oss/env-nextjs: 0.10.1,
jest: 29.7.0,
typescript: 5.4.5
My jest.config.js
is pretty default:
const nextJest = require('next/jest');
const createJestConfig = nextJest({
dir: './',
});
const config = {
coverageProvider: 'v8',
testEnvironment: 'jsdom',
};
module.exports = createJestConfig(config);
from t3-env.
Related Issues (20)
- Installation steps do not work for net new Next.js Apps HOT 1
- Type Error: Type instatiation is excessively deep and possibly infinite HOT 3
- Next 14.2.1 support HOT 4
- Recipe example for Playwright
- T3-env can't find environment variables on github action?
- `createEnv` from `@t3-oss/env-nextjs` returns genric object when using Zod v3.23.0 HOT 22
- Is there a way not to include zod into the bundle? HOT 1
- Using shared variables with no clientPrefix HOT 1
- Validation lib agnostic
- Support for key nesting HOT 1
- Support Custom Prefixes for Client Environment Variables in `@t3-oss/env-nextjs` HOT 1
- Feature request - add support for virtual envs HOT 1
- Feature request - add support for express js
- `@ts-oss/[email protected]` Release Failure
- Shared variables from an extended config throw when used on the client
- How can I use a common variable and a client variable without a prefix? Nuxt 3
- Proposal to add extensions.json
- Issue with Loading Environment Variables in Docker Container HOT 4
- Cannot find module '@t3-oss/env-core' or its corresponding type declarations. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from t3-env.