ngx-utils / cookies Goto Github PK
View Code? Open in Web Editor NEWManage your cookies on client and server side (Angular Universal)
License: MIT License
Manage your cookies on client and server side (Angular Universal)
License: MIT License
I'm getting the following error when i'm running prerender. Can you please merge this PR https://github.com/ngx-utils/cookies/pull/8 ? I think it should help.
Hello, any idea when will this library support Angular 6? Thanks in advance!
Removing a cookie sets it with "undefined" value, instead of effectively removing it.
Can't find doc for these options.
With ng serve, cookies are not working in IE, Edge and Firefox. In chrome it is working
Hi,
Is it possible to have support with angular 7 please?
Error message :
Package "@ngx-utils/cookies" has an incompatible peer dependency to "@angular/core" (requires "^5.0.0" (extended), would install "7.0.1").
Package "@ngx-utils/cookies" has an incompatible peer dependency to "rxjs"(requires "^5.5.6", would install "6.3.3").
R3InjectorError(AppServerModule)[ApplicationModule -> ApplicationRef -> ApplicationInitStatus -> InjectionToken Application Initializer -> [object Object] -> StartupService -> ConfigService -> StorageService -> t -> t -> t]:
NullInjectorError: No provider for t!
After following the official documentation, I got above mentioned error. Tried adding the service in providers also but no luck.
I'm getting
ERROR in src/app/app.module.ts(75,12): error TS-991010: Value at position 1 in the NgModule.imports of AppModule is not a reference: [object Object]
when trying to import
BrowserCookiesModule.forRoot(),
I've digged a bit into this issue on Ivy's github and it seems that this package does not follow the APF (Angular Package Format);
Hi there.
I'm finding some problems when I try to run my express server and I'm using the cookies module.
This is the error:
[universal-sandbox] node dist/server.js
/Users/.../Documents/Playground/universal-sandbox/node_modules/@ngx-utils/cookies/src/browser/index.js:1
(function (exports, require, module, __filename, __dirname) { export * from './browser-cookies.module';
^^^^^^
SyntaxError: Unexpected token export
at createScript (vm.js:74:10)
at Object.runInThisContext (vm.js:116:10)
at Module._compile (module.js:537:28)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/Users/.../Documents/Playground/universal-sandbox/dist/server.js:1:20221)
And this is my config:
_ _ ____ _ ___
/ \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
/ △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
/ ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
/_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
|___/
Angular CLI: 1.5.0
Node: 8.3.0
OS: darwin x64
Angular: 5.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, platform-server, router
@angular/cli: 1.5.0
@angular-devkit/build-optimizer: 0.0.33
@angular-devkit/core: 0.0.21
@angular-devkit/schematics: 0.0.37
@ngtools/json-schema: 1.1.0
@ngtools/webpack: 1.8.0
@schematics/angular: 0.1.7
typescript: 2.4.2
webpack-node-externals: 1.6.0
webpack: 3.8.1
I think it's a problem of ES6 syntax, but I am wondering if it has happened to more people and how did they solve it. Should I transpile the entire module with babel to commonjs target? Is there a way of configuring node so that it runs ES6 code?
Thanks!
I'm getting this error while serving the server code
ERROR { Error: StaticInjectorError[REQUEST]: StaticInjectorError(Platform: core)[REQUEST]: NullInjectorError: No provider for REQUEST!
I followed all the steps in the readme but still the issue.
Hey, i'm trying to configure the service on the server-side and i don't understand the server.ts
part.
Where do I import AppModuleNgFactory
, template
and LAZY_MODULE_MAP
from?
ERROR in node_modules/@ngx-utils/cookies/src/cookies-options.service.d.ts:11:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).
11 static ɵfac: i0.ɵɵFactoryDef;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@ngx-utils/cookies/src/cookies.service.d.ts:22:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).
22 static ɵfac: i0.ɵɵFactoryDef;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@ngx-utils/cookies/src/browser/browser-cookies.service.d.ts:14:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).
14 static ɵfac: i0.ɵɵFactoryDef;
I have a module on npm that depends on @ngx-utils/cookies
, and people are complaining that it raises an error on the new Ivy compiler.
This is the full error I get
ERROR in ./node_modules/angular-ab-tests/__ivy_ngcc__/fesm5/angular-ab-tests.js 464:41-57
"export 'CookiesService' (imported as 'CookiesService$1') was not found in '@ngx-utils/cookies'
ERROR in ./node_modules/angular-ab-tests/__ivy_ngcc__/fesm5/angular-ab-tests.js 466:227-243
"export 'CookiesService' (imported as 'CookiesService$1') was not found in '@ngx-utils/cookies'
ERROR in ./node_modules/angular-ab-tests/__ivy_ngcc__/fesm5/angular-ab-tests.js 472:38-54
"export 'CookiesService' (imported as 'CookiesService$1') was not found in '@ngx-utils/cookies'
ERROR in ./node_modules/@ngx-utils/cookies/__ivy_ngcc__/index.js
Module not found: Error: Can't resolve './src/cookies-options.service' in '[path-to-project]/project-sample/node_modules/@ngx-utils/cookies/__ivy_ngcc__'
ERROR in ./node_modules/@ngx-utils/cookies/__ivy_ngcc__/index.js
Module not found: Error: Can't resolve './src/cookies.service' in '[path-to-project]/project-sample/node_modules/@ngx-utils/cookies/__ivy_ngcc__'
I don't know how the content of the folder __ivy_ngcc__
is generated, but I see that there is an error in
/__ivy_ngcc__/index.js
The content of that file is
export * from './src/cookies.service';
export * from './src/cookies-options.service';
which fails because it tries to load things from a non existing folder src/
inside __ivy_ngcc__
itself.
Correcting it this way it works
export * from '../src/cookies.service';
export * from '../src/cookies-options.service';
I am a bit lost, is this caused by @nx-utils/cookies
, or it's a problem with how I configured the Ivy compiler?
Thanks in advance for the help
I've followed all steps of the guide, but I get the following error when running node server.js
:
../node_modules/@ngx-utils/cookies/src/cookies-options.service.js:1
(function (exports, require, module, __filename, __dirname) { import { Inject, Injectable, InjectionToken, Injector } from '@angular/core';
^^^^^^
SyntaxError: Unexpected token import
I've also added @ngx-utile/cookies
umd file to scripts
in the .angular-cli.json file
, as follows, but it did not work:
"scripts": [
"../node_modules/@ngx-utils/cookies/bundles/cookies.umd.js"
]
Am I missing something?
Is this project abandoned?
I can't believe how insufficient the documentation of Angular Universal is, I want to solve to handle my auth cookies and I found nothing but this, which seems abandoned.
Hey! :)
It look like the "@angular/compiler-cli": "9.0.0" is not compatible with the newest version. I am recieving the error:
`ERROR in node_modules/@ngx-utils/cookies/src/cookies-options.service.d.ts:11:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).
11 static ɵfac: i0.ɵɵFactoryDef;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@ngx-utils/cookies/src/cookies.service.d.ts:22:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).
22 static ɵfac: i0.ɵɵFactoryDef;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
node_modules/@ngx-utils/cookies/src/browser/browser-cookies.service.d.ts:14:18 - error TS2314: Generic type 'ɵɵFactoryDef' requires 2 type argument(s).
14 static ɵfac: i0.ɵɵFactoryDef;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
`
It's possible to upgrade to newest version?
source not define httponly
how to httponly option?
After starting to use this library, my units tests broke. First I get:
NullInjectorError: No provider for CookiesService!
I've tried adding CookiesService, CookiesOptionsService
to the providers, but then I get NullInjectorError: No provider for InjectionToken COOKIES_OPTIONS!
, and I can't get pass that.
I've also tried adding BrowserCookiesModule
to the imports, but still nothing. Any clues?
import { TestBed, inject } from '@angular/core/testing';
import { ListingsService } from './listings.service';
import { HttpClientModule } from '@angular/common/http';
import { BrowserCookiesModule } from '@ngx-utils/cookies/browser';
import { CookiesService, CookiesOptionsService } from '@ngx-utils/cookies';
import { InjectionToken } from '@angular/core';
describe('ListingsService', () => {
beforeEach(() => {
TestBed.configureTestingModule({
providers: [ListingsService, CookiesService, CookiesOptionsService],
imports: [
HttpClientModule,
BrowserCookiesModule
]
});
});
it('should be created', inject([ListingsService], (service: ListingsService) => {
expect(service).toBeTruthy();
}));
});
Will this library be updated to target Angular 5 at some point?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.