ionic-team / stencil

A toolchain for building scalable, enterprise-ready component systems on top of TypeScript and Web Component standards. Stencil components can be distributed natively to React, Angular, Vue, and traditional web developers from a single, framework-agnostic codebase.
https://stenciljs.com
Other
12.5k stars 783 forks source link

RESOLVED: Rollup: undefined - Could not load (file path) #1432

Closed angulartist closed 5 years ago

angulartist commented 5 years ago

Stencil version:

 @stencil/core@0.18.1

I'm submitting a: [X] bug report [ ] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://stencil-worldwide.herokuapp.com/ or https://forum.ionicframework.com/

Current behavior: Using the latest stencil core version and the fresh ionic-pwa starter, i'm getting an error that show up randomly in dev mode. I'm just coding a component and then I got an error like this when stencil tries to compile at the run time : Rollup: undefined

Could not load /Users/techlead/Desktop/article13/article13memes/src/components/app-root/app-root.js
(imported by
/Users/techlead/Desktop/article13/article13memes/src/entry.app-root.ion-app.ion-nav.ion-route.ion-router.js):
 ENOENT: no such file or directory, open '/Users/techlead/Desktop/article13/article13memes/src/components/app-root/app-root.js'

Expected behavior:

Should not happens.

Steps to reproduce:

Related code:

app-root.tsx

/// <reference types="firebase" />

declare const auth: firebase.auth.Auth

import { Component, State } from '@stencil/core'
import { authState } from 'rxfire/auth'

@Component({
  tag: 'app-root',
  styleUrl: 'app-root.css'
})
export class AppRoot {
  @State() currentUserId: string

  componentDidLoad() {
    this.monitorAuth()
  }

  monitorAuth() {
    authState(auth).subscribe((user: firebase.User) => {
      if (user) {
        this.currentUserId = user.uid
      } else {
        return auth.signInAnonymously()
      }
    })
  }

  render() {
    return (
      <ion-app>
        <ion-router useHash={false}>
          <ion-route url='/' component='app-home' />
          <ion-route url='/connecting' component='app-connecting' />
          <ion-route-redirect
            from='*'
            to={this.currentUserId ? '/' : '/connecting'}
          />
        </ion-router>
        <ion-nav />
      </ion-app>
    )
  }
}

Other information:

This error show up whenever I'm trying to edit a component...

arjunyel commented 5 years ago

I believe 0.18.1 has errors, does rolling back to 0.18.0 fix it?

arjunyel commented 5 years ago

And also when you rollback, delete the .stencil folder if you have any issues

angulartist commented 5 years ago

And also when you rollback, delete the .stencil folder if you have any issues

Updating @ionic/core to latest version seems to resolve this, thanks @arjunyel