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

npx stencil build broken after update to 1.16.0 (while fine with 1.15.0) #2561

Closed
lxg opened this issue Jul 8, 2020 · 3 comments
Closed
Labels

Comments

@lxg
Copy link

lxg commented Jul 8, 2020

Stencil version:

@stencil/core@1.16.0

I'm submitting a:
[ x] bug report
[ ] feature request
[ ] support request

Current behavior:
After upgrading an existing application to Stencil 1.16.0 and running "npx stencil build" (with or without additional parameters), I get the following output, and the build fails:

$ npx stencil build
[02:07.8]  @stencil/core v1.16.0 🏊
[02:09.3]  build, awesome-component, prod mode, started ...
[02:09.3]  transpile started ...
[02:10.9]  transpile finished in 1.53 s

[ ERROR ]  TypeScript: ./node_modules/@stencil/core/testing/jest/jest-environment.d.ts:9:44
           Cannot find module 'puppeteer' or its corresponding type declarations.

      L8:  setup(): Promise<void>;
      L9:  newPuppeteerPage(): Promise<import("puppeteer").Page>;
     L10:  closeOpenPages(): Promise<void>;

[ ERROR ]  TypeScript: ./node_modules/@stencil/core/testing/puppeteer/puppeteer-declarations.d.ts:3:28
           Cannot find module 'puppeteer' or its corresponding type declarations.

      L2:  import { EventInitDict, EventSpy, ScreenshotDiff, ScreenshotOptions } from '@stencil/core/internal';
      L3:  import * as puppeteer from 'puppeteer';
      L4:  export interface NewE2EPageOptions extends puppeteer.NavigationOptions {

[ ERROR ]  TypeScript: ./node_modules/@stencil/core/testing/puppeteer/puppeteer-declarations.d.ts:118:64
           Cannot find name 'Buffer'. Do you need to install type definitions for node? Try `npm i @types/node`.

    L117:      _e2eClose(options?: puppeteer.PageCloseOptions): Promise<void>;
    L118:      screenshot(options?: puppeteer.ScreenshotOptions): Promise<Buffer>;
    L119:  }

[ ERROR ]  TypeScript: ./node_modules/@stencil/core/testing/puppeteer/puppeteer-declarations.d.ts:1:23
           Cannot find type definition file for 'node'.

      L1:  /// <reference types="node" />
      L2:  import { EventInitDict, EventSpy, ScreenshotDiff, ScreenshotOptions } from '@stencil/core/internal';

[ ERROR ]  TypeScript: ./src/components/awesome-component/awesome-component.e2e.ts:3:1
           Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i
           @types/jest` or `npm i @types/mocha`.

      L3:  describe('my-awesome-component', () => {
      L4:    it('renders', async () => {

[ ERROR ]  TypeScript: ./src/components/awesome-component/awesome-component.e2e.ts:4:3
           Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or
           `npm i @types/mocha`.

      L3:  describe('my-awesome-component', () => {
      L4:    it('renders', async () => {
      L5:      const page = await newE2EPage();

[ ERROR ]  TypeScript: ./src/components/awesome-component/awesome-component.e2e.ts:9:5
           Cannot find name 'expect'.

      L8:    const element = await page.find('my-awesome-component');
      L9:    expect(element).toHaveClass('hydrated');
     L10:  });

[ ERROR ]  TypeScript: ./src/components/awesome-component/awesome-component.spec.ts:3:1
           Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i
           @types/jest` or `npm i @types/mocha`.

      L3:  describe('my-awesome-component', () => {
      L4:    it('builds', () => {

[ ERROR ]  TypeScript: ./src/components/awesome-component/awesome-component.spec.ts:4:3
           Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or
           `npm i @types/mocha`.

      L3:  describe('my-awesome-component', () => {
      L4:    it('builds', () => {
      L5:      expect(new AwesomeComponent()).toBeTruthy();

[ ERROR ]  TypeScript: ./src/components/awesome-component/awesome-component.spec.ts:5:5
           Cannot find name 'expect'.

      L4:  it('builds', () => {
      L5:    expect(new AwesomeComponent()).toBeTruthy();
      L6:  });

[ ERROR ]  TypeScript: ./src/utils/utils.spec.ts:3:1
           Cannot find name 'describe'. Do you need to install type definitions for a test runner? Try `npm i
           @types/jest` or `npm i @types/mocha`.

      L3:  describe('format', () => {
      L4:    it('returns empty string for no names defined', () => {

[ ERROR ]  TypeScript: ./src/utils/utils.spec.ts:4:3
           Cannot find name 'it'. Do you need to install type definitions for a test runner? Try `npm i @types/jest` or
           `npm i @types/mocha`.

      L3:  describe('format', () => {
      L4:    it('returns empty string for no names defined', () => {
      L5:      expect(format(undefined, undefined, undefined)).toEqual('');

[ ERROR ]  TypeScript: ./src/utils/utils.spec.ts:5:5
           Cannot find name 'expect'.

      L4:  it('returns empty string for no names defined', () => {
      L5:    expect(format(undefined, undefined, undefined)).toEqual('');
      L6:  });

[02:10.9]  build failed in 1.55 s

After downgrading to Stencil 1.15.0, everything works fine again.

@ionitron-bot ionitron-bot bot added the triage label Jul 8, 2020
@Francois-Belanger
Copy link

I also have lots of problem with everything around Firebase with the version 1.16...

Like:

[ WARN ] Bundling Warning UNRESOLVED_IMPORT
'rxjs' is imported by ./node_modules/rxfire/firestore/dist/index.esm.js, but could not be resolved –
treating it as an external dependency

This is not an error, but there is no valid package compiled.

Not there in 1.15.

@jfcere
Copy link

jfcere commented Jul 10, 2020

I had the same error about Cannot find name 'describe'. Do you need to install type definitions for a test runner?...
I ran npm run test and it just installed missing dependencies.

Errors are now gone 👍

@lxg
Copy link
Author

lxg commented Jul 10, 2020

Confirming that 1.16.1 fixes the issue. Thanks! :)

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

No branches or pull requests

3 participants