Angular2 - Import barrels cause 404 at runtime - import

I am trying to implement the import barrels structure that is described in this link (you may have to scroll down a bit) :
https://angular.io/docs/ts/latest/guide/style-guide.html#!#application-structure
The problem I am facing is that the index.ts files that I am creating and referencing like
import {...} from './shared/services';
are not found at runtime and are throwing 404s. If I reference the modules like
import {...} from './shared/services/index';
It works fine. The problem only appears at runtime, typescript does not complain and compiles successfully. I have duplicated the issue in a plunker:
https://plnkr.co/edit/ClE76zuihFTETLDGehnd?p=preview
You can see the error in the console.
Thanks in advance for your help!

I finally found something: https://www.reddit.com/r/Angular2/comments/4i2d9x/support_problem_with_barrels/
It seems, that this is not easily possible with SystemJS, because it can not handle barrel-files.
To solve this, you can add every file as you did with [...]/index or you can add them as a package in SystemJS

Related

Issue migrating to material ui v5 using datepicker and next

Getting Module not found: Can't resolve 'luxon' when using LocalizationProvider with AdapterLuxon and Next
I'm hoping I have something setup incorrectly.
codesandbox with the issue:
https://codesandbox.io/s/package-test-chyxlo?file=/pages/index.js
Turns out I was reading the docs wrong. Mui provides the adapters out of the box but you still need to include the utility package that you want. In my case, luxon.

(Typo3 v11.4.0) Why does importing a recently generated page tree from a working server throw an input error?

I'm trying to import my page tree from a different server, yet when i press preview all pages show the error message: "One of the inputs were not an array!"
Both servers run typo3 v11.4.0
Changing import options does not help.
Changing export options does not help either.
Creating a new,empty root-Homepage with extensions disabled does not help.
Importing with extensions disabled does not help.
Ignoring the error message and importing anyway crashes the server and requires a typo3 reinstall.
I'm happy about any suggestions where to look further into this.
Screenshot of the import screen with Error
Thanks!
After reinstalling multiple times, repeating the same steps (using option: force uid) and ignoring the error message it worked.

Device calendar plugin for Flutter

We are using the device_calendar plugin and we are trying to reproduce the example app in ours. Im running into one error that I dont understand. The error is on the "enum DayOfWeekGroup". It is undefined even though I am including the package import. I tried adding it manually from the example code but it exists outside of the example project so its causing issues.
the plugin is : device_calendar: ^3.0.0+1
The enum exists in src folder outside the example everything else is being pulled into the package from the import but this enum.
This feature is not in the plugin yet, the workaround is use DayOfWeek enum in place of DayOfWeekGroup just in case someone is messing with the new version of device Calendar plugin like I was :)

Weird including problems with AFNetwork?

I've just downloaded AFNetworking to try and mess with it, but i'm having weird errors on including it in my project.
I've just created an empty test project and dropped both AFNetworking and JSONKit in, and immediately i got the error "Lexical or Preprocessor Issue: 'AFNetworking/AFURLConnectionOperation.h' file not found" .
It happens in this row, but changing it to a regular import works for some reason. I could change all of them but I'm trying to understand why this is happening to begin with. I'm sure its some stupid configuration i didn't notice.
#import <AFNetworking/AFURLConnectionOperation.h> // Throws error
#import "AFURLConnectionOperation.h" // Works
Thanks ! :)
Shai
<AFNetworking/AFURLConnectionOperation.h> works if you add AFNetworking as a framework. If you added the files you have to replace the imports with just "AFURLConnectionOperation.h".
The '#import ' syntax is for framework import.
If you just drag&drop the source in your project you've to use '#import "AFURLConnectionOperation.h"'
If you want use a .framework this tutorial can help you: http://db-in.com/blog/2011/07/universal-framework-iphone-ios-2-0/

can't resolve plugin class in grails

i've added a plugin called Image tool plugin for image resizeing... but when i called an instance of it
def imageTool = new ImageTool()
it gives me compilation error cause it can't resolve ImageTool class . i've tried to put import
import org.grails.plugins.imagetools.ImageTool
as a suggestion from a site .. but it didn't work .. so what is the real path to the imageTool so i can import it?? any help please:)
You can't access a class from the default package in a class that's in a package, and ImageTool is in the default package. The easiest thing to do is move that class into a subfolder, e.g. src/imagetool and add "package imagetool" to the source. You'll need to do this for each developer.
The plugin has moved to http://github.com/ricardojmendez/grails-imagetools/ and this has been fixed in that code, but I don't know if they have done a new release.