Ionic-app-scripts: barrels not working on version 0.0.31

Created on 13 Oct 2016  路  13Comments  路  Source: ionic-team/ionic-app-scripts

barrels not working on version 0.0.31
with 0.0.30 they are ok

bug

Most helpful comment

@danbucholtz I just took out the /index workaround for the 349 places where I was using it, and all seems to be well. Great job, and thank you!

All 13 comments

Hi, it seems you have not filled our issue form with the correct information that we ask for. Please re-submit your issue again using the form, not just deleting it.

I can confirm this issue. Here is an extended description:

Short description of the problem:

Watching fails when using a folder path in an import statement, to import from a index.ts file. This was working pre 0.0.31. Example:

folder1/file.ts:

import { something } from '../folder2';

folder2/index.ts:

export function something() {}

Quickfix: when importing from ../folder2/index everything works fine.

[11:41:31]  bundle started ... MEM: 257.0MB 
[ DEBUG! ]  entry: /path/to/app/folder/src/app/main.dev.ts, dest: /path/to/app/folder/www/build/main.js, 
            cache: undefined, format: iife MEM: 257.0MB 
[11:41:31]  copy finished in 9.64 s MEM: 257.4MB 
[11:41:34]  lint finished in 11.91 s MEM: 219.3MB 
[ DEBUG! ]  worker resolve, task: lint, pid: 6230 MEM: 219.3MB 
[ DEBUG! ]  worker exited, task: lint, pid: 6230 MEM: 319.6MB 
(node:6229) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Could not resolve '../auth' from /path/to/app/folder/src/state/clients/clients.reducer.ts

For the following folder structure:

src
- state
-- clients
--- clients.reducer.ts
-- auth
--- index.ts

Which @ionic/app-scripts version are you using?
0.0.33

Hello, thanks! I am going to close this issue as a duplicate of https://github.com/driftyco/ionic-app-scripts/issues/166.

@Manduro,

I'll test this now. Thanks for letting us know.

Thanks,
Dan

@Manduro,

This is working for me with the latest in master. Let me know if you're still seeing this later today after we release the next version please. @andrevcf too. Thanks!

Thanks,
Dan

@danbucholtz I manually brought your changes down to my local copy, but barrels are still failing to compile on dev builds. I still have to use the index workaround. On the other hand, I'm at least getting an error message from the build process!

I'll try this again once an actual release goes out, but I just wanted to give a heads up that all might not be well.

@JustinPierce,

Okay, let me try the dev build. I only did the ngc build. Thanks for the heads up.

Thanks,
Dan

@danbucholtz Interestingly, all of the issues I've had since 0.0.30 have only affected dev builds (and ionic serve, by extension). I think ngc is working some magic behind the scenes.

@JustinPierce, it's not surprising, that's where most of the changes are.

Thanks,
Dan

We did not get this issue resolved in time for 0.0.34 release in final testing right now.

I've gotta look at it more.

Thanks,
Dan

@justin,

I think this is resolved here. Hopefully I didn't miss any test cases. It is working for me locally with forward paths ./some-dir and back paths ../../some-dir.

We'll push this out over the weekend sometime. Please let us know if we need to re-open.

Thanks,
Dan

@danbucholtz Using 0.0.35 this is fixed for my 88 cases where I was using /index as a temporary fix, so you didn't miss any cases :). Thanks!

@danbucholtz I just took out the /index workaround for the 349 places where I was using it, and all seems to be well. Great job, and thank you!

Was this page helpful?
0 / 5 - 0 ratings