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

Installing the latest qwik-types throws error #1

Open
brandonpittman opened this issue Oct 2, 2024 · 0 comments
Open

Installing the latest qwik-types throws error #1

brandonpittman opened this issue Oct 2, 2024 · 0 comments

Comments

@brandonpittman
Copy link
Contributor

brandonpittman commented Oct 2, 2024

I updated my package.json to use the #main address for qwik-types (hoping it had been updated with support for searchParams) and now it throws this error.

/node_modules/@builder.io/qwik-labs/vite/index.js:79
    throw new Error(
          ^

Error: ReferenceError: require is not defined
========================================================================

/**
 * This file is created as part of the typed routes, but it is intended to be modified by the developer.
 *
 * @fileoverview
 */
import { untypedAppUrl, omitProps } from '@builder.io/qwik-labs';
import { type AppLinkProps, type AppRouteParamsFunction } from './routes.gen';
import { type QwikIntrinsicElements } from '@builder.io/qwik';

/**
 * Configure `appUrl` with the typed information of routes.
 */
export const appUrl = untypedAppUrl as AppRouteParamsFunction;

/**
 * Configure `<AppLink/>` component with the typed information of routes.
 *
 * NOTE: you may consider changing `<a>` to `<Link>` to be globally applied across your application.
 */
export function AppLink(props: AppLinkProps & QwikIntrinsicElements['a']) {
  return (
    <a
      href={(appUrl as (route: string, props: any, prefix: string) => string)(
        props.route,
        props,
        'param:'
      )}
      {...omitProps(props, ['href'])}
    >
      {props.children}
    </a>
  );
}

I can do back to this:

    "@builder.io/qwik-labs": "github:BuilderIo/qwik-labs-build#36582dc0503bf665daff9686d2a27d742145795d",

...and things work as before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant