Giter VIP home page Giter VIP logo

astro-env's Introduction

astro-env's People

Contributors

florian-lefebvre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

astro-env's Issues

Pros and Cons comparison

Hello, I greatly appreciate the excellent work you've been doing. I'm interested in learning more about this package.

Could you please explain how the approach adopted by this package is superior to the one used at https://env.t3.gg/docs/core? A brief comparison would be appreciated.

I believe this explanation could also benefit future users.

astro-env breaks PostCSS/Tailwind integration (buildtime)

I tried to use the integration, but I am unsure of why it would cause PostCSS/Tailwind to fail.

You can see the full codebase here. Copied directly from the README.

Sorry if it's something obvious, my brain may be pretty fried right now.

See config here, relevant code pasted below.

export default defineConfig({
  site: "https://undefined.behavio.rs",
  prefetch: true,
  integrations: [tailwind(), sitemap(), robotsTxt(), mdx(), react(), env({
    schema: z.object({
      PUBLIC_VERCEL_GIT_REPO_OWNER: z.string(),
      PUBLIC_VERCEL_GIT_REPO_SLUG: z.string(),
      PUBLIC_VERCEL_GIT_COMMIT_SHA: z.string(),
    }),
  })],
  markdown: {
    syntaxHighlight: false,
    rehypePlugins: [[rehypePrettyCode, prettyOptions]]
  }
});

Build error (from Vercel, it already has environment variables):

[16:43:56.329] Running build in Washington, D.C., USA (East) – iad1
[16:43:56.518] Cloning github.com/Xevion/undefined.behavio.rs (Branch: astro-env, Commit: af29f08)
[16:43:56.910] Cloning completed: 390.573ms
[16:43:59.327] Restored build cache
[16:43:59.441] Running "vercel build"
[16:43:59.998] Vercel CLI 34.2.2
[16:44:00.834] Detected `pnpm-lock.yaml` version 9 generated by pnpm 9
[16:44:00.848] Installing dependencies...
[16:44:02.290] Lockfile is up to date, resolution step is skipped
[16:44:02.409] Progress: resolved 1, reused 0, downloaded 0, added 0
[16:44:02.490] Packages: +20 -43
[16:44:02.491] ++++++++++++++++++++-------------------------------------------
[16:44:03.396] Progress: resolved 20, reused 0, downloaded 20, added 20, done
[16:44:04.124] 
[16:44:04.125] dependencies:
[16:44:04.125] + astro-env 0.0.5
[16:44:04.125] 
[16:44:04.168] Done in 2.8s
[16:44:04.223] Running "pnpm run build"
[16:44:04.744] 
[16:44:04.744] > @0.0.1 build /vercel/path0
[16:44:04.744] > astro check && astro build
[16:44:04.744] 
[16:44:08.695] node:internal/process/promises:288
[16:44:08.696]             triggerUncaughtException(err, true /* fromPromise */);
[16:44:08.696]             ^
[16:44:08.696] 
[16:44:08.697] [Failed to load PostCSS config: Failed to load PostCSS config (searchPath: /vercel/path0): [Failed to load PostCSS config] Failed to load PostCSS config (searchPath: /vercel/path0): [ReferenceError] module is not defined in ES module scope
[16:44:08.697] This file is being treated as an ES module because it has a '.js' file extension and '/vercel/path0/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
[16:44:08.697] ReferenceError: module is not defined in ES module scope
[16:44:08.697] This file is being treated as an ES module because it has a '.js' file extension and '/vercel/path0/package.json' contains "type": "module". To treat it as a CommonJS script, rename it to use the '.cjs' file extension.
[16:44:08.697]     at file:///vercel/path0/postcss.config.js:1:1
[16:44:08.697]     at ModuleJob.run (node:internal/modules/esm/module_job:195:25)
[16:44:08.697]     at async ModuleLoader.import (node:internal/modules/esm/loader:336:24)
[16:44:08.697]     at async importDefault (file:///vercel/path0/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:36556:18)
[16:44:08.697]     at async Object.search (file:///vercel/path0/node_modules/.pnpm/[email protected][email protected]/node_modules/vite/dist/node/chunks/dep-bb8a8339.js:28992:38)
[16:44:08.697] ]
[16:44:08.698] 
[16:44:08.698] Node.js v18.19.1
[16:44:08.716]  ELIFECYCLE  Command failed with exit code 1.
[16:44:08.732] Error: Command "pnpm run build" exited with 1
[16:44:09.862] 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.