I'm trying to install Symfony 2.2 with Sonata Admin Bundle but I'm getting the following error from Composer: - symfony-2.2

Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package sonata-project/admin-bundle could not be found in any version, there may be a typo in the package name.
Problem 2
- The requested package sonata-project/doctrine-orm-admin-bundle could not be found in any version, there may be a typo in the package name.
Problem 3
- The requested package sonata-project/user-bundle could not be found in any version, there may be a typo in the package name.
code de composer.json
{
"name": "symfony/framework-standard-edition",
"description": "The \"Symfony Standard Edition\" distribution",
"autoload": {
"psr-0": { "": "src/" }
},
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"sonata-project/admin-bundle": "*",
"sonata-project/cache-bundle": "*",
"sonata-project/doctrine-orm-admin-bundle": "*",
"stof/doctrine-extensions-bundle": "1.1.x-dev",
"sonata-project/user-bundle": "*",
"sonata-project/easy-extends-bundle": "*",
"friendsofsymfony/user-bundle": "*",
"friendsofsymfony/jsrouting-bundle": "*",
"liip/imagine-bundle": "*",
"simplethings/form-extra-bundle": "dev-master",
"antimattr/google-bundle": "dev-master",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"genemu/form-bundle": "2.1.*",
"behat/behat": "2.4.*#stable",
"behat/mink": "1.4.*#stable",
"behat/symfony2-extension": "*#stable",
"behat/mink-extension": "*#stable",
"behat/mink-selenium2-driver": "*#stable",
"behat/mink-browserkit-driver": "*",
"liip/functional-test-bundle": "dev-master"
},
"scripts": {
"post-install-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
],
"post-update-cmd": [
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile"
]
},
"config": {
"bin-dir": "bin"
},
"minimum-stability": "alpha",
"extra": {
"symfony-app-dir": "app",
"symfony-web-dir": "web",
"branch-alias": {
"dev-master": "2.2-dev"
}
}

You need to specify 'dev-master' and also add the 'Bock-Bundle' dependency.
Just change
"sonata-project/admin-bundle": "",
to
"sonata-project/block-bundle": "dev-master",
"sonata-project/admin-bundle": "dev-master",

try with this in your composer.json:
"sonata-project/admin-bundle": "dev-master",
"sonata-project/cache-bundle": "2.1.",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"knplabs/knp-menu-bundle": "1.1.-dev",
"sonata-project/block-bundle": "dev-master"
It worked for me.

You don't see the "sonata-project/doctrine-orm-admin-bundle dev-master requires knplabs/knp-menu-bundle 1.1.x-dev" error ?

I had very similar problems while using Symfony 2.2 with Sonata Admin Generator and FOS User Bundle.
Here are the config files I created after endless hours of dependency related headache.
Using 'composer update' with this configuration runs without any problem.
composer.json
....
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.2.*",
"doctrine/orm": "~2.2,>=2.2.3",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.1.*",
"symfony/swiftmailer-bundle": "2.2.*",
"symfony/monolog-bundle": "2.2.*",
"sensio/distribution-bundle": "2.2.*",
"sensio/framework-extra-bundle": "2.2.*",
"sensio/generator-bundle": "2.2.*",
"jms/security-extra-bundle": "1.4.*",
"jms/di-extra-bundle": "1.3.*",
"symfony/console": "2.2.*#dev",
"doctrine/doctrine-fixtures-bundle": "dev-master",
"doctrine/data-fixtures" : "dev-master",
"friendsofsymfony/user-bundle": "*",
"doctrine/doctrine-migrations-bundle": "dev-master",
"doctrine/migrations": "dev-master",
"sonata-project/admin-bundle": "dev-master",
"sonata-project/doctrine-orm-admin-bundle": "dev-master",
"sonata-project/intl-bundle": "2.1.*",
"sonata-project/cache-bundle": "2.*",
"sonata-project/block-bundle": "2.2.*#dev",
"simplethings/entity-audit-bundle": "dev-master",
"knplabs/knp-menu-bundle":"1.1.x-dev"
},
....
"minimum-stability": "alpha",
AppKernel.php
public function registerBundles()
{
$bundles = array(
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
new Symfony\Bundle\TwigBundle\TwigBundle(),
new Symfony\Bundle\MonologBundle\MonologBundle(),
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
new Symfony\Bundle\AsseticBundle\AsseticBundle(),
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Doctrine\Bundle\FixturesBundle\DoctrineFixturesBundle(),
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
new JMS\AopBundle\JMSAopBundle(),
new JMS\DiExtraBundle\JMSDiExtraBundle($this),
new JMS\SecurityExtraBundle\JMSSecurityExtraBundle(),
new FOS\UserBundle\FOSUserBundle(),
new Sonata\BlockBundle\SonataBlockBundle(),
new Sonata\jQueryBundle\SonatajQueryBundle(),
new Sonata\AdminBundle\SonataAdminBundle(),
new Sonata\DoctrineORMAdminBundle\SonataDoctrineORMAdminBundle(),
new SimpleThings\EntityAudit\SimpleThingsEntityAuditBundle(),
new Knp\Bundle\MenuBundle\KnpMenuBundle(),
);
Hope this helps!

Related

Composer require private repository from gitlab ssh ignored

I'm trying to pull a private repository from gitlab with composer without any success.
This is what I have in my composer.json file under repositories:
"repositories": [
{
"type": "vcs",
"url": "git#gitlab.com:the-vendor/dashboard-api.git"
}
]
When I clone the project like this: git#gitlab.com:the-vendor/dashboard-api.git manually, everything works fine.
Now when I require the project like so:
"require": {
"the-vendor/dashboard": "dev-orchestrate"
}
I also tried: "dev-main", "dev-main#dev", "dev-orchestrate#dev".
And run: composer update the-vendor/dashboard I get the following error:
Failed to download the-vendor/dashboard-api:The "https://gitlab.com/api/v4/projects/joij%2Fdashboard-api" file could not be downloaded (HTTP/2 404 ):
{"message":"404 Project Not Found"}
Your credentials are required to fetch private repository metadata (git#gitlab.com:the-vendor/dashboard-api.git)
A token will be created and stored in "/root/.composer/auth.json", your password will never be stored
To revoke access to this token you can visit https://gitlab.com/-/profile/personal_access_tokens
Username:
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I'm not sure what to make of this. Composer should be able to clone the project through ssh. But instead I get that vague 404 and then I have to give my username and password.
I also tried this:
"repositories": [
{
"type": "git",
"url": "git#gitlab.com:the-vendor/dashboard-api.git"
}
]
But then it behaves as if there is no "repositories" in the composer json at all, and I get this error:
Problem 1
- Root composer.json requires the-vendor/dashboard, it could not be found in any version, there may be a typo in the package name.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
- It's a private package and you forgot to add a custom repository to find it
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
This is the composer.json of the dashboard-api:
{
"name": "the-vendor/dashboard",
"type": "project",
"description": "TheVendor Dashboards",
"keywords": ["framework", "laravel"],
"license": "proprietary",
"require": {
"php": "^8.1",
"elasticsearch/elasticsearch": "v7.17.0",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.2",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"ext-pdo": "*"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"phpspec/prophecy": "1.15.0",
"spatie/laravel-ignition": "^1.0"
},
"autoload": {
"psr-4": {
"TheVendor\\Dashboard\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"#php artisan package:discover --ansi"
],
"post-update-cmd": [
"#php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"#php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"#php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"providers": [
"TheVendor\\Dashboard\\Providers\\AppServiceProvider",
"TheVendor\\Dashboard\\Providers\\ESClientServiceProvider",
"TheVendor\\Dashboard\\Providers\\ESCreateIndexesServiceProvider"
],
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
I wonder if anyone knows what I'm missing.
Alright! I found the problem. There is no need to go for an auth.json with an API Token. This is where I went wrong:
The main branch had a different package name! The branch I was trying to pull had the right one, but if the main composer.json has a different package name you get this error:
Root composer.json requires the-vendor/dashboard, it could not be found in any version, there may be a typo in the package name.
Once you have that, and require the package like this:
"require": [
"the-vendor/dashboard": "dev-orchestrate"
]
With this in the root of composer.json
"repositories": [
{
"type": "git",
"url": "git#gitlab.com:the-vendor/dashboard-api.git"
}
]
It will simply use ssh to clone the private repository

Visual Stuiod Code Intellisense not working with React Native alias

My React Native project already has alias of some folder. They are put in babel.config.js file:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
'plugins': [
[
'module-resolver',
{
'root': [
'.',
],
'alias': {
'assets/*': './src/assets/*',
'images': './src/assets/images',
'navigation': './src/navigation',
'navigation/*': './src/navigation/*',
'screens': './src/screens',
'screens/*': './src/screens/*',
'splash': './src/modules/splash',
'utils': './src/utils',
'utils/*': './src/utils/*',
'translations': './src/utils/translations',
'translations/*': './src/utils/translations/*',
'msg': './src/utils/translations/msg',
'languages': './languages',
'styles': './src/styles',
'styles/*': './src/styles/*',
'components': './src/components',
'constant': './src/constant',
'context': './src/context',
'api': './src/API',
'store': './src/store',
'store/*': './src/store/*',
},
},
],
'react-native-reanimated/plugin',
],
'env': {
'production': {
'plugins': [
'transform-remove-console',
],
},
},
};
But when I import a function using these alias, the intellisense does not work. I also try to create jsonconfig.json follow this document (https://code.visualstudio.com/docs/languages/jsconfig)
{
"compilerOptions": {
"baseUrl": "./",
"paths": {
"app/*": ["src/app/*"],
"assets/*": ["src/assets/*"],
"images": ["/src/assets/images"],
"navigation": ["/src/navigation"],
"navigation/*": ["/src/navigation/*"],
"screens": ["/src/screens"],
"screens/*": ["/src/screens/*"],
"splash": ["/src/modules/splash"],
"utils": ["/src/utils"],
"utils/*": ["/src/utils/*"],
"translations": ["/src/utils/translations"],
"translations/*": ["/src/utils/translations/*"],
"msg": ["/src/utils/translations/msg"],
"languages": ["/languages"],
"styles": ["/src/styles"],
"styles/*": ["/src/styles/*"],
"components": ["/src/components"],
"constant": ["/src/constant"],
"context": ["/src/context"],
"api": ["/src/API"],
"store": ["/src/store"],
"store/*": ["/src/store/*"],
}
}
}
but still not working. Anyone can help me to fix the intellisense in VS Code?

Cannot use GraphQLObjectType \"Query\" from another module or realm

I am using apollo-server-express to build graphql server
My resolvers in server.js is as simple as that
const express = require('express');
const { ApolloServer } = require('apollo-server-express');
const { importSchema } = require('graphql-import');
const typeDefs = importSchema('./src/schema.graphql');
const prisma = require('./src/prisma');
const server = new ApolloServer({
typeDefs,
resolvers: {
Query: {
users(parent, args, { prisma }, info) {
return prisma.query.users(args, info);
}
}
},
context: ({ req }) => ({ ...req, prisma })
});
const app = express();
server.applyMiddleware({ app });
app.listen({ port: 4000 }, () =>
console.log(`馃殌 Server ready at http://localhost:4000${server.graphqlPath}`)
);
and i am getting this error when i run users query
{
"errors": [
{
"message": "Cannot use GraphQLObjectType \"Query\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results.",
"locations": [
{
"line": 2,
"column": 3
}
],
"path": [
"users"
],
"extensions": {
"code": "INTERNAL_SERVER_ERROR",
"exception": {
"stacktrace": [
"Error: Cannot use GraphQLObjectType \"Query\" from another module or realm.",
"",
"Ensure that there is only one instance of \"graphql\" in the node_modules",
"directory. If different versions of \"graphql\" are the dependencies of other",
"relied on modules, use \"resolutions\" to ensure only one version is installed.",
"",
"https://yarnpkg.com/en/docs/selective-version-resolutions",
"",
"Duplicate \"graphql\" modules cannot be used at the same time since different",
"versions may have different capabilities and behavior. The data from one",
"version used in the function from another could produce confusing and",
"spurious results.",
" at instanceOf (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql\\jsutils\\instanceOf.js:28:13)",
" at isObjectType (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql\\type\\definition.js:116:34)",
" at TypeInfo.enter (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql\\utilities\\TypeInfo.js:163:61)",
" at Object.enter (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql\\language\\visitor.js:369:16)",
" at Object.visit (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql\\language\\visitor.js:242:26)",
" at replaceFieldsWithFragments (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql-tools\\src\\transforms\\ReplaceFieldWithFragment.ts:67:10)",
" at ReplaceFieldWithFragment.transformRequest (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql-tools\\src\\transforms\\ReplaceFieldWithFragment.ts:45:22)",
" at D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql-tools\\src\\transforms\\transforms.ts:24:21",
" at Array.reduce (<anonymous>)",
" at Object.applyRequestTransforms (D:\\00. DEVELOPMENT\\FULL PROJECTS\\social-template-2\\node_modules\\graphql-binding\\node_modules\\graphql-tools\\src\\transforms\\transforms.ts:21:21)"
]
}
}
}
],
"data": null
}
and here is my package.json
{
"name": "social-template-2",
"version": "1.0.0",
"description": "",
"main": "server.js",
"scripts": {
"server": "nodemon --ext js,graphql --exec babel-node server"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"apollo-server-express": "^2.17.0",
"babel-cli": "^6.26.0",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"bcryptjs": "^2.4.3",
"express": "^4.17.1",
"graphql": "^15.3.0",
"graphql-import": "^1.0.2",
"jsonwebtoken": "^8.5.1",
"prisma-binding": "^2.3.16"
},
"devDependencies": {
"#prisma/cli": "^2.7.1",
"concurrently": "^5.3.0",
"nodemon": "^2.0.4"
}
}
Do you have any idea what could be wrong here ?
There is probably another graphql in your node_modules.
try to check it with:
find node_modules -name graphql
then look in package.json of each graphql modules and check what version is there.
Finally, what helped in my case is just uninstalling all packages that contain graphql and install them again together:
npm uninstall apollo-server apollo-server-express graphql neo4j-driver neo4j-graphql-js
npm install apollo-server apollo-server-express graphql neo4j-driver neo4j-graphql-js --force

Npm Publish Issue - Artifactory

I am publishing an npm library to an npm repo on artifactory. The library is built using angular and the dist folder and package.json looks correct. When publishing, the request it's self is published but not the actual artifact.
All i see on artifactory is a single file and not a folder containing my package
Running
npm publish
Package.json
{
"name": "#abce/embedded-auth",
"version": "1.0.0-dev.0",
"main": "bundles/abce-auth.umd.js",
"module": "fesm5/abce-auth.js",
"es2015": "fesm2015/abce-auth.js",
"esm5": "esm5/abce-auth.js",
"esm2015": "esm2015/abce-auth.js",
"fesm5": "fesm5/abce.js",
"fesm2015": "fesm2015/abce-auth.js",
"typings": "abce-auth.d.ts",
"metadata": "abce-auth.metadata.json",
"sideEffects": false,
"dependencies": {
"tslib": "^1.9.0"
}
}
What actually gets published to artifactory in a single file.
{
"_id": "#abce/embedded-auth",
"name": "#abce/embedded-auth",
"dist-tags": {
"latest": "1.0.0-dev.1"
},
"versions": {
"1.0.0-dev.1": {
"name": "#abce/embedded-auth",
"version": "1.0.0-dev.1",
"main": "bundles/abce-auth.umd.js",
"module": "fesm5/abce-auth.js",
"es2015": "fesm2015/abce-auth.js",
"esm5": "esm5/abce-auth.js",
"esm2015": "esm2015/abce-auth.js",
"fesm5": "fesm5/abce-auth.js",
"fesm2015": "fesm2015/abce-auth.js",
"typings": "abce-auth.d.ts",
"metadata": "abce-auth.metadata.json",
"sideEffects": false,
"dependencies": {
"tslib": "^1.9.0"
},
"readme": "ERROR: No README data found!",
"_id": "#abce/embedded-auth#1.0.0-dev.1",
"_npmVersion": "6.4.1",
"_nodeVersion": "10.15.3",
"_npmUser": {
"name": "deployment",
"email": "bob#bob.ie"
},
"maintainers": [
{
"name": "deployment",
"email": "bob#bob.ie"
}
],
"dist": {
"integrity": "sha512-rpTN1sMpwnMwehzWUqbV+zElzaOlF5ekQRCQMncy6c+i4TAp5jbBobvzrhgl0ORqHgJn3Eo+EcrRgYLSjV7MdQ==",
"shasum": "71f654dd5fddb20a9d5063171d5293424a4271c7",
"tarball": "http://abce.jfrog.io/abce/internal-npm-dev/#abce/embedded-auth/-/#abce/embedded-auth-1.0.0-dev.1.tgz"
}
}
},
"readme": "ERROR: No README data found!",
"maintainers": [
{
"name": "deployment",
"email": "bob#bob.ie"
}
],
"_attachments": {
"#abce/embedded-auth-1.0.0-dev.1.tgz": {
"content_type": "application/octet-stream",
"data": "correctly populated tarball base64 data here. I checked it and it is correct",
"length": 12092
}
}
}
Expect:
I would expect the package to be parsed from the request and the package published correctly
Actual:
The put request data from the npm publish command is published as a file
npm version: 6.9.0
node version: v12.3.1(has also been run with 10.15.3)
Any ideas?
Please check the registry URL that you are using from npm, if it doesn't include /api/npm - it is invalid.
Wrong URL: https://domain/artifactory/some-directory/.
Valid URL: https://domain/artifactory/api/npm/some-directory/.

Ngx\clipboard Not working with Aot and Rollup

I have tried to implement aot in my app but While building my app with aot and rollup gets this error.I have used ngx-clipboard.
'ngx-clipboard/src/index' is imported by
wwwroot\app\aot\app\app.module.ngfactory.js, but could not be resolved 螕脟么
treating it as an external dependency
'ngx-clipboard/src/window.service' is
imported by wwwroot\app\aot\app\app.module.ngfactory.js, but could not be
resolved 螕脟么 treating it as an external dependency
'ngx-clipboard/src/clipboard.directive' is imported by
wwwroot\app\aot\app\patients\patient-result\patient-
result.component.ngfactory.js, but could not be resolved 螕脟么 treating it as
an external dependency
'ngx-clipboard/src/clipboard.service' is
imported by wwwroot\app\aot\app\patients\patient-result\patient-
result.component.ngfactory.js, but could not be resolved 螕脟么 treating it a
s an external dependency
'ngx-clipboard/src/document.service' is imported by
wwwroot\app\aot\app\app.module.ngfactory.js, but could not be resolved 螕脟么
treating it as an external dependency
'ngx-clipboard/src/clipboard.service' is imported
by wwwroot\app\aot\app\app.module.ngfactory.js, but could not be resolved
螕脟么 treating it as an external dependency
No name was provided for external module 'ngx-clipboard/src/index' in
options.globals 螕脟么 guessing 'import10'
No name was provided for external module 'ngx-clipboard/src/window.service'
in options.globals 螕脟么 guessing 'import13'
No name was provided for external module 'ngx-
clipboard/src/clipboard.directive' in options.globals 螕脟么 guessing
'import5'
No name was provided for external module 'ngx-
clipboard/src/clipboard.service' in options.globals 螕脟么 guessing 'import28'
No name was provided for external module 'ngx-
clipboard/src/document.service' in options.globals 螕脟么 guessing 'import27'
Here is my package.json
{
"name": "demo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"aot": "node_modules/.bin/ngc -p wwwroot/tsconfig-aot.json",
"rollup": "node_modules/.bin/rollup -c wwwroot/rollup-config.js",
"cleanup": "rimraf wwwroot/app/aot && rimraf wwwroot/build.js"
},
"author": "",
"license": "ISC",
"dependencies": {
"angular/animations": "4.1.3",
"angular/common": "4.1.3",
"angular/compiler": "4.1.3",
"angular/compiler-cli": "4.1.3",
"angular/core": "4.1.3",
"angular/forms": "4.1.3",
"angular/http": "4.1.3",
"angular/material": "2.0.0-beta.6",
"angular/platform-browser": "4.1.3",
"angular/platform-browser-dynamic": "4.1.3",
"angular/platform-server": "4.1.3",
"angular/router": "4.1.3",
"angular/upgrade": "4.1.3",
"core-js": "2.4.1",
"ngx-clipboard": "8.0.3",
"rxjs": "5.4.0",
"systemjs": "0.20.13",
"zone.js": "0.8.11"
},
"devDependencies": {
"ngx-window-token": "0.0.2"
"rollup": "0.43.0",
"rollup-plugin-commonjs": "8.0.2",
"rollup-plugin-node-resolve": "3.0.0",
"rollup-plugin-uglify": "2.0.1",
"typescript": "2.2.2",
"rimraf": "2.6.1"
}
}
Here is my tsconfig-aot.json
{
"compilerOptions": {
"target": "es5",
"module": "es2015",
"moduleResolution": "node",
"sourceMap": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true
},
"files": [
"app/app.module.ts",
"app/main-aot.ts"
],
"angularCompilerOptions": {
"genDir": "app/aot",
"skipMetadataEmit": true
}
}
Here is my rollup.config.js
import nodeResolve from 'rollup-plugin-node-resolve';
import commonjs from 'rollup-plugin-commonjs';
import uglify from 'rollup-plugin-uglify';
export default {
entry: 'wwwroot/app/main-aot.js',
dest: 'wwwroot/build.js', // output a single application bundle
sourceMap: false,
format: 'iife',
onwarn: function (warning) {
// Skip certain warnings
// should intercept ... but doesn't in some rollup versions
if (warning.code === 'THIS_IS_UNDEFINED') { return; }
// console.warn everything else
console.warn(warning.message);
},
plugins: [
nodeResolve({ jsnext: true, module: true }),
commonjs({
include: 'node_modules/**',
}),
uglify()
]
}
Thanks in advance
Try this:
In rollup-config.js import alias
import alias from 'rollup-plugin-alias';
Under plugins add
'ngx-clipboard': __dirname + '/node_modules/ngx-clipboard/dist/',
'ngx-window-token': __dirname + '/node_modules/ngx-window-token/dist/'