question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error: Could not resolve './directives/' from build\index.js

See original GitHub issue

When running npm run build I am getting the following

> @darkedges/framauthui@0.1.0 build C:\development\angular2\framauthui
> gulp build

[06:59:30] Using gulpfile C:\development\angular2\framauthui\gulpfile.js
[06:59:30] Starting 'clean:dist'...
[06:59:30] Finished 'clean:dist' after 255 μs
[06:59:30] Starting 'clean:tmp'...
[06:59:30] Finished 'clean:tmp' after 19 ms
[06:59:30] Starting 'clean:build'...
[06:59:30] Finished 'clean:build' after 24 ms
[06:59:30] Starting 'clean'...
[06:59:30] Finished 'clean' after 49 μs
[06:59:30] Starting 'compile'...
[06:59:30] Starting 'clean:dist'...
[06:59:30] Finished 'clean:dist' after 96 μs
[06:59:30] Starting 'copy:source'...
[06:59:30] Finished 'compile' after 11 ms
[06:59:30] Starting 'build'...
[06:59:30] Finished 'build' after 6.04 μs
[06:59:30] Finished 'copy:source' after 200 ms
[06:59:30] Starting 'inline-resources'...
[06:59:30] Finished 'inline-resources' after 140 ms
[06:59:30] Starting 'ngc'...
[06:59:33] Finished 'ngc' after 2.95 s
[06:59:33] Starting 'rollup:fesm'...
The following options have been renamed — please update your config: format -> output.format
'@angular/common/http' is imported by build\index.js, but could not be resolved – treating it as an external dependency

events.js:137
      throw er; // Unhandled 'error' event
      ^
Error: Could not resolve './directives/' from build\index.js
    at error (C:\development\angular2\framauthui\node_modules\gulp-rollup\node_modules\rollup\dist\rollup.js:170:15)
    at C:\development\angular2\framauthui\node_modules\gulp-rollup\node_modules\rollup\dist\rollup.js:18849:25
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:160:7)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @darkedges/framauthui@0.1.0 build: `gulp build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @darkedges/framauthui@0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\NIrving\AppData\Roaming\npm-cache\_logs\2018-02-07T19_59_34_046Z-debug.log

It would seem it only likes flat file structures and not those build with directories.

In my src directory I have

total 26
drwxr-xr-x 1 NIrving 197121    0 Feb  7 17:04 components/
drwxr-xr-x 1 NIrving 197121    0 Feb  7 17:04 containers/
drwxr-xr-x 1 NIrving 197121    0 Feb  7 17:04 directives/
-rw-r--r-- 1 NIrving 197121 2093 Feb  7 16:49 index.ts
drwxr-xr-x 1 NIrving 197121    0 Feb  7 17:04 interceptors/
drwxr-xr-x 1 NIrving 197121    0 Feb  7 17:04 models/
-rw-r--r-- 1 NIrving 197121  595 Feb  7 17:03 package.json
drwxr-xr-x 1 NIrving 197121    0 Feb  7 17:04 services/
-rw-r--r-- 1 NIrving 197121  637 Feb  7 17:03 tsconfig.es5.json
-rw-r--r-- 1 NIrving 197121  322 Feb  7 17:03 tsconfig.spec.json 

and in src\directives

total 1
drwxr-xr-x 1 NIrving 197121   0 Feb  7 17:04 dynamic-field/
drwxr-xr-x 1 NIrving 197121   0 Feb  7 17:04 form-host/
-rw-r--r-- 1 NIrving 197121 198 Nov  5 05:54 index.ts
drwxr-xr-x 1 NIrving 197121   0 Feb  7 17:04 programmatic-input-fire-event/

Do I need the rollup-plugin-commonjs or rollup-plugin-node-resolve to resolve this? Any ideas?

Thanks Nicholas Irving

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
gary-hollandcommented, May 1, 2018

For those stumbling across this one. After spending way too long on the problem I realised it was an issue with the export. I had:

export * from './directory';

changed it to:

export * from './directory/index';

and the gulp tasks completed.

0reactions
jvandemocommented, May 1, 2018

@gary-holland — Thank you for the update, much appreciated!

Read more comments on GitHub >

github_iconTop Results From Across the Web

error when try to run npm build on react project - Stack Overflow
type SKIP_PREFLIGHT_CHECK=true inside of .env file. this command will help you in resolving this npm error. then try to run npm build and...
Read more >
BUILD FAILED. Error is preventing me from Deploying my site ...
I solved this by upgrading parcel and u/parcel/transformer-sass to version 2.8.1. Both need to be updated.
Read more >
Scripting API: SceneManagement.Scene.buildIndex - Unity
A Scene that is not added to the Scenes in Build window returns a buildIndex one more than the highest in the list....
Read more >
How to get BuildIndex from scene name? - Unity Answers
As it currently stands, there's no good way to do what you want to do. SceneUtility.GetBuildIndexByScenePath can do it if you have the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found