Skip to content

Installing the latest qwik-types throws error #1

@brandonpittman

Description

@brandonpittman

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions