Giter VIP home page Giter VIP logo

Comments (7)

brillout avatar brillout commented on August 25, 2024 1

Fix pre-released as 0.4.176-commit-775d83b.

from vike.

brillout avatar brillout commented on August 25, 2024

What is it you're trying to achieve with meta.client.env = { server: false, client: false }?

I will improve the error message.

from vike.

jonaskuske avatar jonaskuske commented on August 25, 2024

This: #1686 (comment) – only load +client.ts scripts when the app is run in MPA mode. And as described, it works perfectly when I change the config during runtime. But if it's there on startup, it chokes.

This is the config file in the repo, for reference: https://github.com/jonaskuske/thesis/blob/main/renderer%2F%2Bconfig.ts. I have a MODE variable and want to not only toggle clientRouting and Page, but also +client.ts scripts depending on its value.

from vike.

brillout avatar brillout commented on August 25, 2024

Can you do this instead?

// +config.js

import client from './client.jsx'

export default {
  client: process.env.SOME_ENV ? null : client
}

The .jsx file extension is needed, see https://vike.dev/config#pointer-imports and #1500.

from vike.

brillout avatar brillout commented on August 25, 2024

If you remove the assertion at file:///home/jonas/github.com/jonaskuske/thesis/.yarn/__virtual__/vike-virtual-5a5b678e33/0/cache/vike-npm-0.4.175-e0b0805341-691a10e37b.zip/node_modules/vike/dist/esm/shared/page-configs/getConfigValueBuildTime.js:25:5 does everything work then?

from vike.

jonaskuske avatar jonaskuske commented on August 25, 2024

I'll give it a try later, thanks!

Otherwise the manual pointer import should be okay for now as I don't have too many +client.ts files, but not a perfect solution as I can't configure in one place but have to add a separate +config.ts for every +client.ts file.

from vike.

jonaskuske avatar jonaskuske commented on August 25, 2024

Yup, everything works once I remove that assertion!

(jonaskuske/thesis@1b4af53 and jonaskuske/thesis@8fe069c)

from vike.

Related Issues (20)

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.