Popular New Releases in Parser
marked
v4.0.14
swc
PHP-Parser
PHP-Parser 4.12.0
showdown
2.0.4 (2022-04-21)
antlr4
4.10 Major feature, code clean up, and bug fix release
Popular Libraries in Parser
by markedjs javascript
27341 NOASSERTION
A markdown parser and compiler. Built for speed.
by swc-project rust
21677 Apache-2.0
Rust-based platform for the Web
by jamiebuilds javascript
20705 CC-BY-4.0
:snowman: Possibly the smallest compiler ever
by ruanyf javascript
19345 NOASSERTION
《ECMAScript 6入门》是一本开源的 JavaScript 语言教程,全面介绍 ECMAScript 6 新增的语法特性。
by nikic php
14794 BSD-3-Clause
A PHP parser written in PHP
by erusev php
13809 MIT
Better Markdown Parser in PHP
by markdown-it javascript
13290 MIT
Markdown parser, done right. 100% CommonMark support, extensions, syntax plugins & high speed
by showdownjs javascript
12425 MIT
A bidirectional Markdown to HTML to Markdown converter written in Javascript
by antlr java
11930 NOASSERTION
ANTLR (ANother Tool for Language Recognition) is a powerful parser generator for reading, processing, executing, or translating structured text or binary files.
Trending New libraries in Parser
by thx javascript
2862 MIT
GoGoCode is a transformer for JavaScript/Typescript/HTML based on AST but providing a more intuitive API.
by apple swift
2618 Apache-2.0
Straightforward, type-safe argument parsing for Swift
by balazsbotond typescript
1414 MIT
A URL builder library for JavaScript.
by afnanenayet rust
1114 MIT
A tree-sitter based AST difftool to get meaningful semantic diffs
by google rust
930 BSD-3-Clause
Rust derive-based argument parsing optimized for code size
by doctrine html
915 MIT
A lightweight php class for formatting sql statements. Handles automatic indentation and syntax highlighting.
by baidu python
586 Apache-2.0
百度开源的依存句法分析系统
by sethvargo go
578 Apache-2.0
A Go library for parsing struct tags from environment variables.
by sebastianbergmann php
535 NOASSERTION
Library for parsing CLI options
Top Authors in Parser
1
31 Libraries
9879
2
29 Libraries
504
3
15 Libraries
16566
4
14 Libraries
162
5
11 Libraries
5713
6
11 Libraries
245
7
11 Libraries
403
8
10 Libraries
337
9
10 Libraries
4592
10
9 Libraries
108
1
31 Libraries
9879
2
29 Libraries
504
3
15 Libraries
16566
4
14 Libraries
162
5
11 Libraries
5713
6
11 Libraries
245
7
11 Libraries
403
8
10 Libraries
337
9
10 Libraries
4592
10
9 Libraries
108
Trending Kits in Parser
A well-liked web-based format for storing and transmitting structured data is XML (Extensible Markup Language). XML files can hold images, dates, text, and numbers. C++ developers typically use libraries that provide an interface for reading, editing, and altering XML files. Commonly used XML parsing and manipulation libraries are the XML libraries.
Working with XML data in C++ applications is made much easier with the help of C++ XML libraries. These libraries allow developers to read, write, and manipulate XML data fast and effectively, making data-driven application design, data analysis, and other activities easier.
Here is the list of 8 Best C++ XML Libraries
TinyXML2:
- Has embedded systems that require a small footprint.
- Useful for mobile apps that need to parse or generate XML data.
- Useful for educational projects that introduce XML parsing to beginners.
PugiXML:
- Helps in making data-driven applications that need to store or retrieve XML data.
- Helps make web applications that work with RESTful APIs.
- Helps with scientific or engineering software that uses XML for input/output.
RapidXML:
- Helps create video games that use XML to save files or configuration data.
- Helps in mobile apps that need to parse or generate XML data.
- Helps in scientific simulations that use XML for input/output.
QtOfficeOpenXML:
- Helps in GUI applications that use XML for configuration or data exchange.
- Helps create cross-platform applications that require a powerful XML parser.
- Helps mobile apps that need to work with XML-based APIs.
Property_Tree:
- Helps in configuration files for desktop or web applications.
- Helps create unit testing frameworks that use XML for input/output.
- Helps in integration tests that use XML for test data.
LibXMLplusplus:
- Helps in web browsers that need to parse HTML or XHTML documents.
- Helps in content management systems that handle XML content.
- Helps in system utilities that use XML for configuration files.
Xerces-C++:
- Useful for enterprise applications that need to process large XML documents.
- Helps create web services that use XML-based protocols.
- Helps in high-performance data processing applications.
CMarkup:
- Helps create web scrapers that need to extract data from HTML or XML documents.
- Helps industrial control systems that use XML for data exchange.
- Helps robotics software that uses XML for sensor data exchange.
YAML parser libraries are important tools for handling YAML data within applications. A human-readable data serialization format is used for configuration files and data exchange. Developers use these libraries to parse YAML data and convert it into objects. It helps with easy manipulation and consumption within Node.js applications.
Node.js applications are allowed by the YAML parser libraries. It helps communicate with services that use YAML as their data exchange format. These libraries handle the parsing of YAML data complexities, including error handling and reporting. These libraries support schema validation, custom type handling, and serialization/deserialization. Node.js YAML parser libraries simplify working with YAML data in applications. It offers convenient methods for parsing, manipulating, and generating YAML. They enable seamless integration with YAML-based systems and promote code readability. It helps enhance productivity for developers working with YAML.
Here are the best libraries organized by use cases. The best libraries are Yjs, Yaml, js-yaml, yaml-front-matter, yaml-loader, yamlinc, and yaml-boost. A detailed review of each library follows.
Let's look at each library in detail. The links allow you to access package commands, installation notes, and code snippets.
yjs:
- It can refer to these libraries' underlying YAML parsing and serialization capabilities.
- It is a lightweight YAML parser with a focus on simplicity and speed.
- YAML JavaScript is not a specific library or component in Node.js for parsing YAML.
- It is used for data serialization format supported by many programming languages.
yaml:
- It is a human-readable data serialization format.
- It uses a simple and intuitive syntax that is easy for humans to read and write.
- It is used in continuous integration/deployment pipelines and infrastructure-as-code (IaC) tools.
- It has support for a wide range of programming languages, including Node.js.
js-yaml:
- It allows you to parse YAML data into JavaScript objects. It can be manipulated and processed within your Node.js application.
- It enables you to convert JavaScript objects into YAML representation.
- It provides robust support for these YAML features to work with complex YAML data in Node.js.
- It has a vibrant community of developers and maintainers. It ensures the library receives regular updates, bug fixes, and security patches.
yaml-front-matter:
- It is a block of YAML-formatted metadata placed at the beginning of a file.
- It can also manage configuration settings for a specific file or document.
- It enables the extraction, manipulation, and use of metadata associated with a document.
- Using this, developers can define custom properties and values. It provides extra flexibility and customization options for their content.
yaml-loader:
- This module is used with YAML parser libraries and is a loader for YAML files in the Node.js application.
- It helps load YAML configuration files to manage application settings and options.
- It allows you to apply these features while loading YAML files. It gives you more control over the parsing and transformation process.
- Using this, you can instruct these build tools to handle YAML files during the build process.
yamlinc:
- It enables you to modularize YAML configurations by splitting them into separate files.
- It helps address this issue by breaking the configuration into smaller, manageable files.
- When using yamlinc, if a shared setting or component needs to be updated, you only need to modify it in one place.
- It can be used with other YAML parsing libraries in Node.js, such as js-yaml.
yaml-boost:
- It is a YAML parser for Node.js that focuses on performance and flexibility.
- It supports YAML 1.2 specification. It provides options for controlling the parsing, like custom schema and tag resolvers.
- It provides a convenient and reliable way to work with YAML data in JavaScript.
- It helps read, write, and manipulate YAML files and integrate YAML functionality.
FAQ:
1. What is a YAML document, and how does it relate to the Nodejs yaml parser library?
A YAML document is a human-readable data serialization format for representing structured data. It stands for "YAML Ain't Markup Language". It is used for configuration files and data exchange. It is also used as a language-independent alternative to JSON. The YAML parser library refers to a software package. It allows you to parse and manipulate YAML documents. Several YAML parser libraries are available for Node.js, such as js-yaml, yaml, and yamljs.
2. What does this library support some data schemas?
The data schemas that this node.js yaml parser library supports are:
- js-yaml
- yaml
3. How do I understand the internals of the node.js yaml parser library?
Understanding a specific library requires studying the source code and its implementation details. Here is an approach you can follow to understand the internals of the Node.js YAML parser library:
- Start with the library's documentation.
- Locate the source code.
- Explore the codebase.
- Read the code comments.
- Identify the parsing algorithm.
- Follow the code flow.
- Study relevant dependencies.
- Experiment and debug.
- Consult extra resources.
4. How do I use Parse & Stringify operations with this node.js yaml parser library?
To use parse and stringify operations with this library, you can follow these steps:
- Install the YAML parser library.
- Import the YAML parser.
- Parsing YAML.
- Stringifying YAML.
5. Can you explain the syntax used in the node.js yaml parser library?
The js-yaml library provides two methods for parsing YAML: yaml.safeload() and yaml.load(). Here's an explanation of their syntax:
yaml.safeLoad(yamlString, options):
This method loads and parses a YAML string into a JavaScript object.
yaml.load(yamlString, options):
This method is like yaml.safeLoad(). But it supports more advanced YAML features, such as custom tags and constructors.
Here are some of the famous Node JS URL Parsing Libraries. The use cases of these libraries include URL Parsing for Web Applications, Content Management System (CMS) Integration, Building RESTful APIs, URL Shortening: Node, and Image Manipulation.
Node JS URL Parsing Libraries are libraries that allow Node JS developers to parse URLs. This enables developers to easily access and manipulate the components of a URL. These libraries provide a powerful API for parsing, manipulating, and reconstructing URLs.
Let us look at some of these famous libraries.
quety-string
- Supports custom separators, which can be used to parse query strings with different syntaxes.
- Allows developers to parse arrays as values.
- Allows developers to parse deeply nested query strings.
URI.js
- Is a fully open-source library, meaning that users can freely use and modify the code.
- Has extensive documentation and a comprehensive test suite, making it easy to use and debug.
- Provides a comprehensive set of functions for manipulating and analyzing URLs
url-parse
- Has built-in support for the WHATWG URL Standard, allowing developers to easily handle internationalized URLs.
- Offers a convenient and intuitive API for manipulating URLs and query parameters.
- Allows developers to easily extend the library with custom parsers for specific URL formats.
node-querystring
- Is written in pure JavaScript and optimized for performance.
- Comes with detailed documentation, examples, and API reference.
- Supports parsing and stringifying both traditional and non-traditional query strings.
node-url
- Provides pathname normalization, which simplifies the process of building URLs from components.
- Supports multiple URL formats including file://, ftp://, http://, and https://.
- Provides a built-in query string parser allowing easy conversion of query strings into JavaScript objects
url-regex
- Is lightweight, fast, and supports both Node.js and browser environments.
- Supports both lazy and greedy matching, allowing users to specify how much of a URL string should be searched for a match.
- Is well-documented, making it easier for users to understand how to use it.
url-join
- Is designed to be compatible with the URL spec and RFC 3986, meaning that it can be used to construct URLs compliant with the standard.
- Supports the addition of query parameters to existing URLs, preserving existing parameters.
- Provides an easy way to normalize and standardize URLs, ensuring they look and work properly.
JSoup is a Java library used to engage with real HTML. It gives a technique to govern and parse HTML texts. JSoup can clean HTML documents.
It can extract data from HTML and do other HTML-related tasks. Utilizing Jsoup, you may parse HTML or XML tags. It aids of using the usage of the pick-out feature of the Document class. Additionally, JSoup offers APIs for editing HTML documents and adding new elements. JSoup is a versatile tool that parses XML tags in Java and works with XML in Java. It can apply to many uses. They must process, change, or parse XML data.
Here are a few times while you may use it:
- Web scraping: It is the use of JSoup. It lets you pull data from XML documents. You download them from the internet. These documents can be RSS feeds or API answers.
- Data mining: JSoup can extract statistics for evaluation from large XML collections.
- You can use JSoup to read and confirm the HTML produced by a web app for automated testing of web applications.
- A Java program can process XML documents. It can also change them using JSoup.
- You can use JSoup in a Java application to interpret XML documents from other systems.
Here is an example of how you can parse XML tags using JSoup in Java for your application:
Fig 1: Preview of the code snippet which I copied from the kandi.
Fig 2: code snippet continuation.
Fig 3: Preview of the output that you will get on running this code from your IDE.
Code
Using jsoup your code will be looks like this:
Instructions
- Copy the code using the "Copy" button above, and paste it in a Java file in your IDE(IntelliJ Preferable).
- Add the required dependencies and import them in java file.
- Run the file to generate the output.
I hope you found this useful. I have added the link to dependent libraries, version information in the following sections.
I found this code snippet by searching for 'how to parse nested xml tag with same tag name' in kandi. You can try any such use case!
Environment Tested
I tested this solution in the following IDE and versions. Be mindful of changes when working with other versions.
- The solution is created in IntelliJ IDE and Java jdk-'11.0.17'.
- The solution is tested on jsoup version-'1.7.2'
Using this solution, we are able to parse xml tags using jsoup in Java with simple steps. This process also facilities an easy way to use, hassle-free method to create a hands-on working version of code which would help us to parse the xml tags using jsoup in Java.
Dependent Libraries
You can add the dependent library in your gradle or maven files. you can get the dependancy xml in above link
You can search for any dependent library on kandi like jsoup java.
FAQ
1. How to parse XML using Jsoup in Java?
To parse XML with Jsoup in Java, use the Jsoup.parse() method, providing the XML string as input.
2. Can Jsoup handle large XML files?
Jsoup is better for parsing HTML. For large XML files, use dedicated XML parsers like JAXB or SAX.
3. How to select XML elements with Jsoup selectors?
Use Jsoup selectors. They are like CSS selectors. They target and extract specific XML elements from the parsed document.
4. Is Jsoup suitable for parsing complex XML structures?
The creators of Jsoup designed it for HTML parsing. For complex XML structures, consider using specialized XML libraries like DOM or StAX.
5. How to extract data from XML attributes using Jsoup?
Use Jsoup's Element.attr() method to retrieve values from XML attributes.
Support
- For any support on kandi solution kits, please use the chat
- For further learning resources, visit the Open Weaver Community learning page.
Trending Discussions on Parser
ESLint: 8.0.0 Failed to load plugin '@typescript-eslint'
The unauthenticated git protocol on port 9418 is no longer supported
Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
Components not included in Strapi api response
ESlint - Error: Must use import to load ES Module
ESLint Definition for rule 'import/extensions' was not found
How to fix: "@angular/fire"' has no exported member 'AngularFireModule'.ts(2305) ionic, firebase, angular
pytube: AttributeError: 'NoneType' object has no attribute 'span'
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.json of a module in node_modules
How to combine and then branch in MonadPlus/Alternative
QUESTION
ESLint: 8.0.0 Failed to load plugin '@typescript-eslint'
Asked 2022-Mar-31 at 09:08Could you help me, I've got this error when I try building a project?
Oops! Something went wrong! :(
ESLint: 8.0.0
TypeError: Failed to load plugin '@typescript-eslint' declared in 'src.eslintrc': Class extends value undefined is not a constructor or null Referenced from: src.eslintrc
package.json
1 "devDependencies": {
2 "@typescript-eslint/eslint-plugin": "^4.33.0",
3 "@typescript-eslint/parser": "^4.33.0",
4 "browserslist": "^4.17.3",
5 "eslint": "^8.0.0",
6 "eslint-config-prettier": "^8.3.0",
7 "eslint-plugin-import": "^2.24.2",
8 "eslint-plugin-prettier": "^4.0.0",
9 "eslint-plugin-react": "^7.26.1",
10 "prettier": "^2.3.2",
11 }
12
.eslintrc
1 "devDependencies": {
2 "@typescript-eslint/eslint-plugin": "^4.33.0",
3 "@typescript-eslint/parser": "^4.33.0",
4 "browserslist": "^4.17.3",
5 "eslint": "^8.0.0",
6 "eslint-config-prettier": "^8.3.0",
7 "eslint-plugin-import": "^2.24.2",
8 "eslint-plugin-prettier": "^4.0.0",
9 "eslint-plugin-react": "^7.26.1",
10 "prettier": "^2.3.2",
11 }
12 "parser": "@typescript-eslint/parser",
13 "extends": [
14 "eslint:recommended",
15 "plugin:@typescript-eslint/eslint-recommended",
16 "plugin:@typescript-eslint/recommended",
17 "plugin:react/recommended",
18 "plugin:@typescript-eslint/recommended",
19 "plugin:prettier/recommended",
20 "prettier"
21 ],
22 "plugins": ["@typescript-eslint"],
23
ANSWER
Answered 2021-Oct-10 at 10:33https://github.com/typescript-eslint/typescript-eslint/issues/3982
It seems to be a compatibility problem
QUESTION
The unauthenticated git protocol on port 9418 is no longer supported
Asked 2022-Mar-27 at 13:23I have been using github actions for quite sometime but today my deployments started failing. Below is the error from github action logs
1Command: git
2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
3Directory: /home/runner/work/stackstream-fe/stackstream-fe
4Output:
5fatal: remote error:
6 The unauthenticated git protocol on port 9418 is no longer supported.
7
Upon investigation, it appears that below section in my yml file is causing the issue.
1Command: git
2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
3Directory: /home/runner/work/stackstream-fe/stackstream-fe
4Output:
5fatal: remote error:
6 The unauthenticated git protocol on port 9418 is no longer supported.
7 - name: Installing modules
8 run: yarn install
9
I have looked into this change log but can't seem to comprehend the issue.
Additional Details: Server: EC2 Instance Github actions steps:
1Command: git
2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
3Directory: /home/runner/work/stackstream-fe/stackstream-fe
4Output:
5fatal: remote error:
6 The unauthenticated git protocol on port 9418 is no longer supported.
7 - name: Installing modules
8 run: yarn install
9 steps:
10 - name: Checkout
11 uses: actions/checkout@v2
12
13 - id: vars
14 run: |
15 if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo "::set-output name=environment::prod_stackstream" ; echo "::set-output name=api-url::api" ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo "::set-output name=environment::staging_stackstream" ; echo "::set-output name=api-url::stagingapi" ; else echo "::set-output name=environment::dev_stackstream" ; echo "::set-output name=api-url::devapi" ; fi
16
17 - uses: pCYSl5EDgo/cat@master
18 id: slack
19 with:
20 path: .github/workflows/slack.txt
21
22 - name: Slack Start Notification
23 uses: 8398a7/action-slack@v3
24 env:
25 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
26 ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
27 COLOR: good
28 STATUS: '`Started`'
29 with:
30 status: custom
31 fields: workflow,job,commit,repo,ref,author,took
32 custom_payload: |
33 ${{ steps.slack.outputs.text }}
34
35 - name: Installing modules
36 env:
37 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
38 run: yarn install
39
40 - name: Create Frontend Build
41 env:
42 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
43 run: yarn build
44
45 - name: Deploy to Frontend Server DEV
46 if: ${{ contains(github.ref, 'dev') }}
47 uses: easingthemes/ssh-deploy@v2.1.5
48 env:
49 SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
50 ARGS: '-rltgoDzvO --delete'
51 SOURCE: 'deploy/'
52 REMOTE_HOST: ${{ secrets.DEV_HOST }}
53 REMOTE_USER: plyfolio-dev
54 TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
55
package.json file
1Command: git
2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
3Directory: /home/runner/work/stackstream-fe/stackstream-fe
4Output:
5fatal: remote error:
6 The unauthenticated git protocol on port 9418 is no longer supported.
7 - name: Installing modules
8 run: yarn install
9 steps:
10 - name: Checkout
11 uses: actions/checkout@v2
12
13 - id: vars
14 run: |
15 if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo "::set-output name=environment::prod_stackstream" ; echo "::set-output name=api-url::api" ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo "::set-output name=environment::staging_stackstream" ; echo "::set-output name=api-url::stagingapi" ; else echo "::set-output name=environment::dev_stackstream" ; echo "::set-output name=api-url::devapi" ; fi
16
17 - uses: pCYSl5EDgo/cat@master
18 id: slack
19 with:
20 path: .github/workflows/slack.txt
21
22 - name: Slack Start Notification
23 uses: 8398a7/action-slack@v3
24 env:
25 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
26 ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
27 COLOR: good
28 STATUS: '`Started`'
29 with:
30 status: custom
31 fields: workflow,job,commit,repo,ref,author,took
32 custom_payload: |
33 ${{ steps.slack.outputs.text }}
34
35 - name: Installing modules
36 env:
37 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
38 run: yarn install
39
40 - name: Create Frontend Build
41 env:
42 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
43 run: yarn build
44
45 - name: Deploy to Frontend Server DEV
46 if: ${{ contains(github.ref, 'dev') }}
47 uses: easingthemes/ssh-deploy@v2.1.5
48 env:
49 SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
50 ARGS: '-rltgoDzvO --delete'
51 SOURCE: 'deploy/'
52 REMOTE_HOST: ${{ secrets.DEV_HOST }}
53 REMOTE_USER: plyfolio-dev
54 TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
55 {
56 "name": "stackstream-fe",
57 "version": "1.0.0",
58 "authors": [
59 "fayyaznofal@gmail.com"
60 ],
61 "private": true,
62 "dependencies": {
63 "@fortawesome/fontawesome-svg-core": "^1.2.34",
64 "@fortawesome/free-solid-svg-icons": "^5.15.2",
65 "@fortawesome/react-fontawesome": "^0.1.14",
66 "@fullcalendar/bootstrap": "^5.5.0",
67 "@fullcalendar/core": "^5.5.0",
68 "@fullcalendar/daygrid": "^5.5.0",
69 "@fullcalendar/interaction": "^5.5.0",
70 "@fullcalendar/react": "^5.5.0",
71 "@lourenci/react-kanban": "^2.1.0",
72 "@redux-saga/simple-saga-monitor": "^1.1.2",
73 "@testing-library/jest-dom": "^5.11.9",
74 "@testing-library/react": "^11.2.3",
75 "@testing-library/user-event": "^12.6.0",
76 "@toast-ui/react-chart": "^1.0.2",
77 "@types/jest": "^26.0.14",
78 "@types/node": "^14.10.3",
79 "@types/react": "^16.9.49",
80 "@types/react-dom": "^16.9.8",
81 "@vtaits/react-color-picker": "^0.1.1",
82 "apexcharts": "^3.23.1",
83 "availity-reactstrap-validation": "^2.7.0",
84 "axios": "^0.21.1",
85 "axios-mock-adapter": "^1.19.0",
86 "axios-progress-bar": "^1.2.0",
87 "bootstrap": "^5.0.0-beta2",
88 "chart.js": "^2.9.4",
89 "chartist": "^0.11.4",
90 "classnames": "^2.2.6",
91 "components": "^0.1.0",
92 "dotenv": "^8.2.0",
93 "draft-js": "^0.11.7",
94 "echarts": "^4.9.0",
95 "echarts-for-react": "^2.0.16",
96 "firebase": "^8.2.3",
97 "google-maps-react": "^2.0.6",
98 "history": "^4.10.1",
99 "i": "^0.3.6",
100 "i18next": "^19.8.4",
101 "i18next-browser-languagedetector": "^6.0.1",
102 "jsonwebtoken": "^8.5.1",
103 "leaflet": "^1.7.1",
104 "lodash": "^4.17.21",
105 "lodash.clonedeep": "^4.5.0",
106 "lodash.get": "^4.4.2",
107 "metismenujs": "^1.2.1",
108 "mkdirp": "^1.0.4",
109 "moment": "2.29.1",
110 "moment-timezone": "^0.5.32",
111 "nouislider-react": "^3.3.9",
112 "npm": "^7.6.3",
113 "prop-types": "^15.7.2",
114 "query-string": "^6.14.0",
115 "react": "^16.13.1",
116 "react-apexcharts": "^1.3.7",
117 "react-auth-code-input": "^1.0.0",
118 "react-avatar": "^3.10.0",
119 "react-bootstrap": "^1.5.0",
120 "react-bootstrap-editable": "^0.8.2",
121 "react-bootstrap-sweetalert": "^5.2.0",
122 "react-bootstrap-table-next": "^4.0.3",
123 "react-bootstrap-table2-editor": "^1.4.0",
124 "react-bootstrap-table2-paginator": "^2.1.2",
125 "react-bootstrap-table2-toolkit": "^2.1.3",
126 "react-chartist": "^0.14.3",
127 "react-chartjs-2": "^2.11.1",
128 "react-color": "^2.19.3",
129 "react-confirm-alert": "^2.7.0",
130 "react-content-loader": "^6.0.1",
131 "react-countdown": "^2.3.1",
132 "react-countup": "^4.3.3",
133 "react-cropper": "^2.1.4",
134 "react-data-table-component": "^6.11.8",
135 "react-date-picker": "^8.0.6",
136 "react-datepicker": "^3.4.1",
137 "react-dom": "^16.13.1",
138 "react-draft-wysiwyg": "^1.14.5",
139 "react-drag-listview": "^0.1.8",
140 "react-drawer": "^1.3.4",
141 "react-dropzone": "^11.2.4",
142 "react-dual-listbox": "^2.0.0",
143 "react-facebook-login": "^4.1.1",
144 "react-flatpickr": "^3.10.6",
145 "react-google-login": "^5.2.2",
146 "react-hook-form": "^7.15.2",
147 "react-i18next": "^11.8.5",
148 "react-icons": "^4.2.0",
149 "react-image-lightbox": "^5.1.1",
150 "react-input-mask": "^2.0.4",
151 "react-jvectormap": "^0.0.16",
152 "react-leaflet": "^3.0.5",
153 "react-meta-tags": "^1.0.1",
154 "react-modal-video": "^1.2.6",
155 "react-notifications": "^1.7.2",
156 "react-number-format": "^4.7.3",
157 "react-perfect-scrollbar": "^1.5.8",
158 "react-rangeslider": "^2.2.0",
159 "react-rating": "^2.0.5",
160 "react-rating-tooltip": "^1.1.6",
161 "react-redux": "^7.2.1",
162 "react-responsive-carousel": "^3.2.11",
163 "react-router-dom": "^5.2.0",
164 "react-script": "^2.0.5",
165 "react-scripts": "3.4.3",
166 "react-select": "^4.3.1",
167 "react-sparklines": "^1.7.0",
168 "react-star-ratings": "^2.3.0",
169 "react-super-responsive-table": "^5.2.0",
170 "react-switch": "^6.0.0",
171 "react-table": "^7.6.3",
172 "react-toastify": "^7.0.3",
173 "react-toastr": "^3.0.0",
174 "react-twitter-auth": "0.0.13",
175 "reactstrap": "^8.8.1",
176 "recharts": "^2.0.8",
177 "redux": "^4.0.5",
178 "redux-saga": "^1.1.3",
179 "reselect": "^4.0.0",
180 "sass": "^1.37.5",
181 "simplebar-react": "^2.3.0",
182 "styled": "^1.0.0",
183 "styled-components": "^5.2.1",
184 "toastr": "^2.1.4",
185 "typescript": "^4.0.2",
186 "universal-cookie": "^4.0.4"
187 },
188 "devDependencies": {
189 "@typescript-eslint/eslint-plugin": "^2.27.0",
190 "@typescript-eslint/parser": "^2.27.0",
191 "@typescript-eslint/typescript-estree": "^4.15.2",
192 "eslint-config-prettier": "^6.10.1",
193 "eslint-plugin-prettier": "^3.1.2",
194 "husky": "^4.2.5",
195 "lint-staged": "^10.1.3",
196 "prettier": "^1.19.1",
197 "react-test-renderer": "^16.13.1",
198 "redux-devtools-extension": "^2.13.8",
199 "redux-mock-store": "^1.5.4"
200 },
201 "scripts": {
202 "start": "react-scripts start",
203 "build": "react-scripts build && mv build ./deploy/build",
204 "build-local": "react-scripts build",
205 "test": "react-scripts test",
206 "eject": "react-scripts eject"
207 },
208 "eslintConfig": {
209 "extends": "react-app"
210 },
211 "husky": {
212 "hooks": {
213 "pre-commit": "lint-staged"
214 }
215 },
216 "lint-staged": {
217 "*.{js,ts,tsx}": [
218 "eslint --fix"
219 ]
220 },
221 "browserslist": {
222 "production": [
223 ">0.2%",
224 "not dead",
225 "not op_mini all"
226 ],
227 "development": [
228 "last 1 chrome version",
229 "last 1 firefox version",
230 "last 1 safari version"
231 ]
232 }
233}
234
ANSWER
Answered 2022-Mar-16 at 07:01First, this error message is indeed expected on Jan. 11th, 2022.
See "Improving Git protocol security on GitHub".
January 11, 2022 Final brownout.
This is the full brownout period where we’ll temporarily stop accepting the deprecated key and signature types, ciphers, and MACs, and the unencrypted Git protocol.
This will help clients discover any lingering use of older keys or old URLs.
Second, check your package.json
dependencies for any git://
URL, as in this example, fixed in this PR.
As noted by Jörg W Mittag:
There was a 4-month warning.
The entire Internet has been moving away from unauthenticated, unencrypted protocols for a decade, it's not like this is a huge surprise.Personally, I consider it less an "issue" and more "detecting unmaintained dependencies".
Plus, this is still only the brownout period, so the protocol will only be disabled for a short period of time, allowing developers to discover the problem.
The permanent shutdown is not until March 15th.
For GitHub Actions:
As in actions/checkout issue 14, you can add as a first step:
1Command: git
2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
3Directory: /home/runner/work/stackstream-fe/stackstream-fe
4Output:
5fatal: remote error:
6 The unauthenticated git protocol on port 9418 is no longer supported.
7 - name: Installing modules
8 run: yarn install
9 steps:
10 - name: Checkout
11 uses: actions/checkout@v2
12
13 - id: vars
14 run: |
15 if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo "::set-output name=environment::prod_stackstream" ; echo "::set-output name=api-url::api" ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo "::set-output name=environment::staging_stackstream" ; echo "::set-output name=api-url::stagingapi" ; else echo "::set-output name=environment::dev_stackstream" ; echo "::set-output name=api-url::devapi" ; fi
16
17 - uses: pCYSl5EDgo/cat@master
18 id: slack
19 with:
20 path: .github/workflows/slack.txt
21
22 - name: Slack Start Notification
23 uses: 8398a7/action-slack@v3
24 env:
25 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
26 ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
27 COLOR: good
28 STATUS: '`Started`'
29 with:
30 status: custom
31 fields: workflow,job,commit,repo,ref,author,took
32 custom_payload: |
33 ${{ steps.slack.outputs.text }}
34
35 - name: Installing modules
36 env:
37 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
38 run: yarn install
39
40 - name: Create Frontend Build
41 env:
42 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
43 run: yarn build
44
45 - name: Deploy to Frontend Server DEV
46 if: ${{ contains(github.ref, 'dev') }}
47 uses: easingthemes/ssh-deploy@v2.1.5
48 env:
49 SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
50 ARGS: '-rltgoDzvO --delete'
51 SOURCE: 'deploy/'
52 REMOTE_HOST: ${{ secrets.DEV_HOST }}
53 REMOTE_USER: plyfolio-dev
54 TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
55 {
56 "name": "stackstream-fe",
57 "version": "1.0.0",
58 "authors": [
59 "fayyaznofal@gmail.com"
60 ],
61 "private": true,
62 "dependencies": {
63 "@fortawesome/fontawesome-svg-core": "^1.2.34",
64 "@fortawesome/free-solid-svg-icons": "^5.15.2",
65 "@fortawesome/react-fontawesome": "^0.1.14",
66 "@fullcalendar/bootstrap": "^5.5.0",
67 "@fullcalendar/core": "^5.5.0",
68 "@fullcalendar/daygrid": "^5.5.0",
69 "@fullcalendar/interaction": "^5.5.0",
70 "@fullcalendar/react": "^5.5.0",
71 "@lourenci/react-kanban": "^2.1.0",
72 "@redux-saga/simple-saga-monitor": "^1.1.2",
73 "@testing-library/jest-dom": "^5.11.9",
74 "@testing-library/react": "^11.2.3",
75 "@testing-library/user-event": "^12.6.0",
76 "@toast-ui/react-chart": "^1.0.2",
77 "@types/jest": "^26.0.14",
78 "@types/node": "^14.10.3",
79 "@types/react": "^16.9.49",
80 "@types/react-dom": "^16.9.8",
81 "@vtaits/react-color-picker": "^0.1.1",
82 "apexcharts": "^3.23.1",
83 "availity-reactstrap-validation": "^2.7.0",
84 "axios": "^0.21.1",
85 "axios-mock-adapter": "^1.19.0",
86 "axios-progress-bar": "^1.2.0",
87 "bootstrap": "^5.0.0-beta2",
88 "chart.js": "^2.9.4",
89 "chartist": "^0.11.4",
90 "classnames": "^2.2.6",
91 "components": "^0.1.0",
92 "dotenv": "^8.2.0",
93 "draft-js": "^0.11.7",
94 "echarts": "^4.9.0",
95 "echarts-for-react": "^2.0.16",
96 "firebase": "^8.2.3",
97 "google-maps-react": "^2.0.6",
98 "history": "^4.10.1",
99 "i": "^0.3.6",
100 "i18next": "^19.8.4",
101 "i18next-browser-languagedetector": "^6.0.1",
102 "jsonwebtoken": "^8.5.1",
103 "leaflet": "^1.7.1",
104 "lodash": "^4.17.21",
105 "lodash.clonedeep": "^4.5.0",
106 "lodash.get": "^4.4.2",
107 "metismenujs": "^1.2.1",
108 "mkdirp": "^1.0.4",
109 "moment": "2.29.1",
110 "moment-timezone": "^0.5.32",
111 "nouislider-react": "^3.3.9",
112 "npm": "^7.6.3",
113 "prop-types": "^15.7.2",
114 "query-string": "^6.14.0",
115 "react": "^16.13.1",
116 "react-apexcharts": "^1.3.7",
117 "react-auth-code-input": "^1.0.0",
118 "react-avatar": "^3.10.0",
119 "react-bootstrap": "^1.5.0",
120 "react-bootstrap-editable": "^0.8.2",
121 "react-bootstrap-sweetalert": "^5.2.0",
122 "react-bootstrap-table-next": "^4.0.3",
123 "react-bootstrap-table2-editor": "^1.4.0",
124 "react-bootstrap-table2-paginator": "^2.1.2",
125 "react-bootstrap-table2-toolkit": "^2.1.3",
126 "react-chartist": "^0.14.3",
127 "react-chartjs-2": "^2.11.1",
128 "react-color": "^2.19.3",
129 "react-confirm-alert": "^2.7.0",
130 "react-content-loader": "^6.0.1",
131 "react-countdown": "^2.3.1",
132 "react-countup": "^4.3.3",
133 "react-cropper": "^2.1.4",
134 "react-data-table-component": "^6.11.8",
135 "react-date-picker": "^8.0.6",
136 "react-datepicker": "^3.4.1",
137 "react-dom": "^16.13.1",
138 "react-draft-wysiwyg": "^1.14.5",
139 "react-drag-listview": "^0.1.8",
140 "react-drawer": "^1.3.4",
141 "react-dropzone": "^11.2.4",
142 "react-dual-listbox": "^2.0.0",
143 "react-facebook-login": "^4.1.1",
144 "react-flatpickr": "^3.10.6",
145 "react-google-login": "^5.2.2",
146 "react-hook-form": "^7.15.2",
147 "react-i18next": "^11.8.5",
148 "react-icons": "^4.2.0",
149 "react-image-lightbox": "^5.1.1",
150 "react-input-mask": "^2.0.4",
151 "react-jvectormap": "^0.0.16",
152 "react-leaflet": "^3.0.5",
153 "react-meta-tags": "^1.0.1",
154 "react-modal-video": "^1.2.6",
155 "react-notifications": "^1.7.2",
156 "react-number-format": "^4.7.3",
157 "react-perfect-scrollbar": "^1.5.8",
158 "react-rangeslider": "^2.2.0",
159 "react-rating": "^2.0.5",
160 "react-rating-tooltip": "^1.1.6",
161 "react-redux": "^7.2.1",
162 "react-responsive-carousel": "^3.2.11",
163 "react-router-dom": "^5.2.0",
164 "react-script": "^2.0.5",
165 "react-scripts": "3.4.3",
166 "react-select": "^4.3.1",
167 "react-sparklines": "^1.7.0",
168 "react-star-ratings": "^2.3.0",
169 "react-super-responsive-table": "^5.2.0",
170 "react-switch": "^6.0.0",
171 "react-table": "^7.6.3",
172 "react-toastify": "^7.0.3",
173 "react-toastr": "^3.0.0",
174 "react-twitter-auth": "0.0.13",
175 "reactstrap": "^8.8.1",
176 "recharts": "^2.0.8",
177 "redux": "^4.0.5",
178 "redux-saga": "^1.1.3",
179 "reselect": "^4.0.0",
180 "sass": "^1.37.5",
181 "simplebar-react": "^2.3.0",
182 "styled": "^1.0.0",
183 "styled-components": "^5.2.1",
184 "toastr": "^2.1.4",
185 "typescript": "^4.0.2",
186 "universal-cookie": "^4.0.4"
187 },
188 "devDependencies": {
189 "@typescript-eslint/eslint-plugin": "^2.27.0",
190 "@typescript-eslint/parser": "^2.27.0",
191 "@typescript-eslint/typescript-estree": "^4.15.2",
192 "eslint-config-prettier": "^6.10.1",
193 "eslint-plugin-prettier": "^3.1.2",
194 "husky": "^4.2.5",
195 "lint-staged": "^10.1.3",
196 "prettier": "^1.19.1",
197 "react-test-renderer": "^16.13.1",
198 "redux-devtools-extension": "^2.13.8",
199 "redux-mock-store": "^1.5.4"
200 },
201 "scripts": {
202 "start": "react-scripts start",
203 "build": "react-scripts build && mv build ./deploy/build",
204 "build-local": "react-scripts build",
205 "test": "react-scripts test",
206 "eject": "react-scripts eject"
207 },
208 "eslintConfig": {
209 "extends": "react-app"
210 },
211 "husky": {
212 "hooks": {
213 "pre-commit": "lint-staged"
214 }
215 },
216 "lint-staged": {
217 "*.{js,ts,tsx}": [
218 "eslint --fix"
219 ]
220 },
221 "browserslist": {
222 "production": [
223 ">0.2%",
224 "not dead",
225 "not op_mini all"
226 ],
227 "development": [
228 "last 1 chrome version",
229 "last 1 firefox version",
230 "last 1 safari version"
231 ]
232 }
233}
234 - name: Fix up git URLs
235 run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
236
That will change any git://github.com/
into https://github.com/
.
For all your repositories, you can set:
1Command: git
2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
3Directory: /home/runner/work/stackstream-fe/stackstream-fe
4Output:
5fatal: remote error:
6 The unauthenticated git protocol on port 9418 is no longer supported.
7 - name: Installing modules
8 run: yarn install
9 steps:
10 - name: Checkout
11 uses: actions/checkout@v2
12
13 - id: vars
14 run: |
15 if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo "::set-output name=environment::prod_stackstream" ; echo "::set-output name=api-url::api" ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo "::set-output name=environment::staging_stackstream" ; echo "::set-output name=api-url::stagingapi" ; else echo "::set-output name=environment::dev_stackstream" ; echo "::set-output name=api-url::devapi" ; fi
16
17 - uses: pCYSl5EDgo/cat@master
18 id: slack
19 with:
20 path: .github/workflows/slack.txt
21
22 - name: Slack Start Notification
23 uses: 8398a7/action-slack@v3
24 env:
25 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
26 ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
27 COLOR: good
28 STATUS: '`Started`'
29 with:
30 status: custom
31 fields: workflow,job,commit,repo,ref,author,took
32 custom_payload: |
33 ${{ steps.slack.outputs.text }}
34
35 - name: Installing modules
36 env:
37 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
38 run: yarn install
39
40 - name: Create Frontend Build
41 env:
42 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
43 run: yarn build
44
45 - name: Deploy to Frontend Server DEV
46 if: ${{ contains(github.ref, 'dev') }}
47 uses: easingthemes/ssh-deploy@v2.1.5
48 env:
49 SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
50 ARGS: '-rltgoDzvO --delete'
51 SOURCE: 'deploy/'
52 REMOTE_HOST: ${{ secrets.DEV_HOST }}
53 REMOTE_USER: plyfolio-dev
54 TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
55 {
56 "name": "stackstream-fe",
57 "version": "1.0.0",
58 "authors": [
59 "fayyaznofal@gmail.com"
60 ],
61 "private": true,
62 "dependencies": {
63 "@fortawesome/fontawesome-svg-core": "^1.2.34",
64 "@fortawesome/free-solid-svg-icons": "^5.15.2",
65 "@fortawesome/react-fontawesome": "^0.1.14",
66 "@fullcalendar/bootstrap": "^5.5.0",
67 "@fullcalendar/core": "^5.5.0",
68 "@fullcalendar/daygrid": "^5.5.0",
69 "@fullcalendar/interaction": "^5.5.0",
70 "@fullcalendar/react": "^5.5.0",
71 "@lourenci/react-kanban": "^2.1.0",
72 "@redux-saga/simple-saga-monitor": "^1.1.2",
73 "@testing-library/jest-dom": "^5.11.9",
74 "@testing-library/react": "^11.2.3",
75 "@testing-library/user-event": "^12.6.0",
76 "@toast-ui/react-chart": "^1.0.2",
77 "@types/jest": "^26.0.14",
78 "@types/node": "^14.10.3",
79 "@types/react": "^16.9.49",
80 "@types/react-dom": "^16.9.8",
81 "@vtaits/react-color-picker": "^0.1.1",
82 "apexcharts": "^3.23.1",
83 "availity-reactstrap-validation": "^2.7.0",
84 "axios": "^0.21.1",
85 "axios-mock-adapter": "^1.19.0",
86 "axios-progress-bar": "^1.2.0",
87 "bootstrap": "^5.0.0-beta2",
88 "chart.js": "^2.9.4",
89 "chartist": "^0.11.4",
90 "classnames": "^2.2.6",
91 "components": "^0.1.0",
92 "dotenv": "^8.2.0",
93 "draft-js": "^0.11.7",
94 "echarts": "^4.9.0",
95 "echarts-for-react": "^2.0.16",
96 "firebase": "^8.2.3",
97 "google-maps-react": "^2.0.6",
98 "history": "^4.10.1",
99 "i": "^0.3.6",
100 "i18next": "^19.8.4",
101 "i18next-browser-languagedetector": "^6.0.1",
102 "jsonwebtoken": "^8.5.1",
103 "leaflet": "^1.7.1",
104 "lodash": "^4.17.21",
105 "lodash.clonedeep": "^4.5.0",
106 "lodash.get": "^4.4.2",
107 "metismenujs": "^1.2.1",
108 "mkdirp": "^1.0.4",
109 "moment": "2.29.1",
110 "moment-timezone": "^0.5.32",
111 "nouislider-react": "^3.3.9",
112 "npm": "^7.6.3",
113 "prop-types": "^15.7.2",
114 "query-string": "^6.14.0",
115 "react": "^16.13.1",
116 "react-apexcharts": "^1.3.7",
117 "react-auth-code-input": "^1.0.0",
118 "react-avatar": "^3.10.0",
119 "react-bootstrap": "^1.5.0",
120 "react-bootstrap-editable": "^0.8.2",
121 "react-bootstrap-sweetalert": "^5.2.0",
122 "react-bootstrap-table-next": "^4.0.3",
123 "react-bootstrap-table2-editor": "^1.4.0",
124 "react-bootstrap-table2-paginator": "^2.1.2",
125 "react-bootstrap-table2-toolkit": "^2.1.3",
126 "react-chartist": "^0.14.3",
127 "react-chartjs-2": "^2.11.1",
128 "react-color": "^2.19.3",
129 "react-confirm-alert": "^2.7.0",
130 "react-content-loader": "^6.0.1",
131 "react-countdown": "^2.3.1",
132 "react-countup": "^4.3.3",
133 "react-cropper": "^2.1.4",
134 "react-data-table-component": "^6.11.8",
135 "react-date-picker": "^8.0.6",
136 "react-datepicker": "^3.4.1",
137 "react-dom": "^16.13.1",
138 "react-draft-wysiwyg": "^1.14.5",
139 "react-drag-listview": "^0.1.8",
140 "react-drawer": "^1.3.4",
141 "react-dropzone": "^11.2.4",
142 "react-dual-listbox": "^2.0.0",
143 "react-facebook-login": "^4.1.1",
144 "react-flatpickr": "^3.10.6",
145 "react-google-login": "^5.2.2",
146 "react-hook-form": "^7.15.2",
147 "react-i18next": "^11.8.5",
148 "react-icons": "^4.2.0",
149 "react-image-lightbox": "^5.1.1",
150 "react-input-mask": "^2.0.4",
151 "react-jvectormap": "^0.0.16",
152 "react-leaflet": "^3.0.5",
153 "react-meta-tags": "^1.0.1",
154 "react-modal-video": "^1.2.6",
155 "react-notifications": "^1.7.2",
156 "react-number-format": "^4.7.3",
157 "react-perfect-scrollbar": "^1.5.8",
158 "react-rangeslider": "^2.2.0",
159 "react-rating": "^2.0.5",
160 "react-rating-tooltip": "^1.1.6",
161 "react-redux": "^7.2.1",
162 "react-responsive-carousel": "^3.2.11",
163 "react-router-dom": "^5.2.0",
164 "react-script": "^2.0.5",
165 "react-scripts": "3.4.3",
166 "react-select": "^4.3.1",
167 "react-sparklines": "^1.7.0",
168 "react-star-ratings": "^2.3.0",
169 "react-super-responsive-table": "^5.2.0",
170 "react-switch": "^6.0.0",
171 "react-table": "^7.6.3",
172 "react-toastify": "^7.0.3",
173 "react-toastr": "^3.0.0",
174 "react-twitter-auth": "0.0.13",
175 "reactstrap": "^8.8.1",
176 "recharts": "^2.0.8",
177 "redux": "^4.0.5",
178 "redux-saga": "^1.1.3",
179 "reselect": "^4.0.0",
180 "sass": "^1.37.5",
181 "simplebar-react": "^2.3.0",
182 "styled": "^1.0.0",
183 "styled-components": "^5.2.1",
184 "toastr": "^2.1.4",
185 "typescript": "^4.0.2",
186 "universal-cookie": "^4.0.4"
187 },
188 "devDependencies": {
189 "@typescript-eslint/eslint-plugin": "^2.27.0",
190 "@typescript-eslint/parser": "^2.27.0",
191 "@typescript-eslint/typescript-estree": "^4.15.2",
192 "eslint-config-prettier": "^6.10.1",
193 "eslint-plugin-prettier": "^3.1.2",
194 "husky": "^4.2.5",
195 "lint-staged": "^10.1.3",
196 "prettier": "^1.19.1",
197 "react-test-renderer": "^16.13.1",
198 "redux-devtools-extension": "^2.13.8",
199 "redux-mock-store": "^1.5.4"
200 },
201 "scripts": {
202 "start": "react-scripts start",
203 "build": "react-scripts build && mv build ./deploy/build",
204 "build-local": "react-scripts build",
205 "test": "react-scripts test",
206 "eject": "react-scripts eject"
207 },
208 "eslintConfig": {
209 "extends": "react-app"
210 },
211 "husky": {
212 "hooks": {
213 "pre-commit": "lint-staged"
214 }
215 },
216 "lint-staged": {
217 "*.{js,ts,tsx}": [
218 "eslint --fix"
219 ]
220 },
221 "browserslist": {
222 "production": [
223 ">0.2%",
224 "not dead",
225 "not op_mini all"
226 ],
227 "development": [
228 "last 1 chrome version",
229 "last 1 firefox version",
230 "last 1 safari version"
231 ]
232 }
233}
234 - name: Fix up git URLs
235 run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
236git config --global url."https://github.com/".insteadOf git://github.com/
237
You can also use SSH, but GitHub Security reminds us that, as of March 15th, 2022, GitHub stopped accepting DSA keys. RSA keys uploaded after Nov 2, 2021 will work only with SHA-2 signatures.
The deprecated MACs, ciphers, and unencrypted Git protocol are permanently disabled.
So this (with the right key) would work:
1Command: git
2Arguments: ls-remote --tags --heads git://github.com/adobe-webplatform/eve.git
3Directory: /home/runner/work/stackstream-fe/stackstream-fe
4Output:
5fatal: remote error:
6 The unauthenticated git protocol on port 9418 is no longer supported.
7 - name: Installing modules
8 run: yarn install
9 steps:
10 - name: Checkout
11 uses: actions/checkout@v2
12
13 - id: vars
14 run: |
15 if [ '${{ github.ref }}' == 'refs/heads/master' ]; then echo "::set-output name=environment::prod_stackstream" ; echo "::set-output name=api-url::api" ; elif [ '${{ github.ref }}' == 'refs/heads/staging' ]; then echo "::set-output name=environment::staging_stackstream" ; echo "::set-output name=api-url::stagingapi" ; else echo "::set-output name=environment::dev_stackstream" ; echo "::set-output name=api-url::devapi" ; fi
16
17 - uses: pCYSl5EDgo/cat@master
18 id: slack
19 with:
20 path: .github/workflows/slack.txt
21
22 - name: Slack Start Notification
23 uses: 8398a7/action-slack@v3
24 env:
25 SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
26 ENVIRONMENT: '`${{ steps.vars.outputs.environment }}`'
27 COLOR: good
28 STATUS: '`Started`'
29 with:
30 status: custom
31 fields: workflow,job,commit,repo,ref,author,took
32 custom_payload: |
33 ${{ steps.slack.outputs.text }}
34
35 - name: Installing modules
36 env:
37 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
38 run: yarn install
39
40 - name: Create Frontend Build
41 env:
42 REACT_APP_API_URL: 'https://${{ steps.vars.outputs.api-url }}mergestack.com/api/v1'
43 run: yarn build
44
45 - name: Deploy to Frontend Server DEV
46 if: ${{ contains(github.ref, 'dev') }}
47 uses: easingthemes/ssh-deploy@v2.1.5
48 env:
49 SSH_PRIVATE_KEY: ${{ secrets.DEV_KEY }}
50 ARGS: '-rltgoDzvO --delete'
51 SOURCE: 'deploy/'
52 REMOTE_HOST: ${{ secrets.DEV_HOST }}
53 REMOTE_USER: plyfolio-dev
54 TARGET: '/home/plyfolio-dev/${{ steps.vars.outputs.environment }}/fe/deploy'
55 {
56 "name": "stackstream-fe",
57 "version": "1.0.0",
58 "authors": [
59 "fayyaznofal@gmail.com"
60 ],
61 "private": true,
62 "dependencies": {
63 "@fortawesome/fontawesome-svg-core": "^1.2.34",
64 "@fortawesome/free-solid-svg-icons": "^5.15.2",
65 "@fortawesome/react-fontawesome": "^0.1.14",
66 "@fullcalendar/bootstrap": "^5.5.0",
67 "@fullcalendar/core": "^5.5.0",
68 "@fullcalendar/daygrid": "^5.5.0",
69 "@fullcalendar/interaction": "^5.5.0",
70 "@fullcalendar/react": "^5.5.0",
71 "@lourenci/react-kanban": "^2.1.0",
72 "@redux-saga/simple-saga-monitor": "^1.1.2",
73 "@testing-library/jest-dom": "^5.11.9",
74 "@testing-library/react": "^11.2.3",
75 "@testing-library/user-event": "^12.6.0",
76 "@toast-ui/react-chart": "^1.0.2",
77 "@types/jest": "^26.0.14",
78 "@types/node": "^14.10.3",
79 "@types/react": "^16.9.49",
80 "@types/react-dom": "^16.9.8",
81 "@vtaits/react-color-picker": "^0.1.1",
82 "apexcharts": "^3.23.1",
83 "availity-reactstrap-validation": "^2.7.0",
84 "axios": "^0.21.1",
85 "axios-mock-adapter": "^1.19.0",
86 "axios-progress-bar": "^1.2.0",
87 "bootstrap": "^5.0.0-beta2",
88 "chart.js": "^2.9.4",
89 "chartist": "^0.11.4",
90 "classnames": "^2.2.6",
91 "components": "^0.1.0",
92 "dotenv": "^8.2.0",
93 "draft-js": "^0.11.7",
94 "echarts": "^4.9.0",
95 "echarts-for-react": "^2.0.16",
96 "firebase": "^8.2.3",
97 "google-maps-react": "^2.0.6",
98 "history": "^4.10.1",
99 "i": "^0.3.6",
100 "i18next": "^19.8.4",
101 "i18next-browser-languagedetector": "^6.0.1",
102 "jsonwebtoken": "^8.5.1",
103 "leaflet": "^1.7.1",
104 "lodash": "^4.17.21",
105 "lodash.clonedeep": "^4.5.0",
106 "lodash.get": "^4.4.2",
107 "metismenujs": "^1.2.1",
108 "mkdirp": "^1.0.4",
109 "moment": "2.29.1",
110 "moment-timezone": "^0.5.32",
111 "nouislider-react": "^3.3.9",
112 "npm": "^7.6.3",
113 "prop-types": "^15.7.2",
114 "query-string": "^6.14.0",
115 "react": "^16.13.1",
116 "react-apexcharts": "^1.3.7",
117 "react-auth-code-input": "^1.0.0",
118 "react-avatar": "^3.10.0",
119 "react-bootstrap": "^1.5.0",
120 "react-bootstrap-editable": "^0.8.2",
121 "react-bootstrap-sweetalert": "^5.2.0",
122 "react-bootstrap-table-next": "^4.0.3",
123 "react-bootstrap-table2-editor": "^1.4.0",
124 "react-bootstrap-table2-paginator": "^2.1.2",
125 "react-bootstrap-table2-toolkit": "^2.1.3",
126 "react-chartist": "^0.14.3",
127 "react-chartjs-2": "^2.11.1",
128 "react-color": "^2.19.3",
129 "react-confirm-alert": "^2.7.0",
130 "react-content-loader": "^6.0.1",
131 "react-countdown": "^2.3.1",
132 "react-countup": "^4.3.3",
133 "react-cropper": "^2.1.4",
134 "react-data-table-component": "^6.11.8",
135 "react-date-picker": "^8.0.6",
136 "react-datepicker": "^3.4.1",
137 "react-dom": "^16.13.1",
138 "react-draft-wysiwyg": "^1.14.5",
139 "react-drag-listview": "^0.1.8",
140 "react-drawer": "^1.3.4",
141 "react-dropzone": "^11.2.4",
142 "react-dual-listbox": "^2.0.0",
143 "react-facebook-login": "^4.1.1",
144 "react-flatpickr": "^3.10.6",
145 "react-google-login": "^5.2.2",
146 "react-hook-form": "^7.15.2",
147 "react-i18next": "^11.8.5",
148 "react-icons": "^4.2.0",
149 "react-image-lightbox": "^5.1.1",
150 "react-input-mask": "^2.0.4",
151 "react-jvectormap": "^0.0.16",
152 "react-leaflet": "^3.0.5",
153 "react-meta-tags": "^1.0.1",
154 "react-modal-video": "^1.2.6",
155 "react-notifications": "^1.7.2",
156 "react-number-format": "^4.7.3",
157 "react-perfect-scrollbar": "^1.5.8",
158 "react-rangeslider": "^2.2.0",
159 "react-rating": "^2.0.5",
160 "react-rating-tooltip": "^1.1.6",
161 "react-redux": "^7.2.1",
162 "react-responsive-carousel": "^3.2.11",
163 "react-router-dom": "^5.2.0",
164 "react-script": "^2.0.5",
165 "react-scripts": "3.4.3",
166 "react-select": "^4.3.1",
167 "react-sparklines": "^1.7.0",
168 "react-star-ratings": "^2.3.0",
169 "react-super-responsive-table": "^5.2.0",
170 "react-switch": "^6.0.0",
171 "react-table": "^7.6.3",
172 "react-toastify": "^7.0.3",
173 "react-toastr": "^3.0.0",
174 "react-twitter-auth": "0.0.13",
175 "reactstrap": "^8.8.1",
176 "recharts": "^2.0.8",
177 "redux": "^4.0.5",
178 "redux-saga": "^1.1.3",
179 "reselect": "^4.0.0",
180 "sass": "^1.37.5",
181 "simplebar-react": "^2.3.0",
182 "styled": "^1.0.0",
183 "styled-components": "^5.2.1",
184 "toastr": "^2.1.4",
185 "typescript": "^4.0.2",
186 "universal-cookie": "^4.0.4"
187 },
188 "devDependencies": {
189 "@typescript-eslint/eslint-plugin": "^2.27.0",
190 "@typescript-eslint/parser": "^2.27.0",
191 "@typescript-eslint/typescript-estree": "^4.15.2",
192 "eslint-config-prettier": "^6.10.1",
193 "eslint-plugin-prettier": "^3.1.2",
194 "husky": "^4.2.5",
195 "lint-staged": "^10.1.3",
196 "prettier": "^1.19.1",
197 "react-test-renderer": "^16.13.1",
198 "redux-devtools-extension": "^2.13.8",
199 "redux-mock-store": "^1.5.4"
200 },
201 "scripts": {
202 "start": "react-scripts start",
203 "build": "react-scripts build && mv build ./deploy/build",
204 "build-local": "react-scripts build",
205 "test": "react-scripts test",
206 "eject": "react-scripts eject"
207 },
208 "eslintConfig": {
209 "extends": "react-app"
210 },
211 "husky": {
212 "hooks": {
213 "pre-commit": "lint-staged"
214 }
215 },
216 "lint-staged": {
217 "*.{js,ts,tsx}": [
218 "eslint --fix"
219 ]
220 },
221 "browserslist": {
222 "production": [
223 ">0.2%",
224 "not dead",
225 "not op_mini all"
226 ],
227 "development": [
228 "last 1 chrome version",
229 "last 1 firefox version",
230 "last 1 safari version"
231 ]
232 }
233}
234 - name: Fix up git URLs
235 run: echo -e '[url "https://github.com/"]\n insteadOf = "git://github.com/"' >> ~/.gitconfig
236git config --global url."https://github.com/".insteadOf git://github.com/
237git config --global url."git@github.com:".insteadOf git://github.com/
238
That will change any git://github.com/
(unencrypted Git protocol) into git@github.com:
(SSH URL).
QUESTION
Java, Intellij IDEA problem Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
Asked 2022-Mar-26 at 15:23I have newly installed
1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14
I cloned project I work with on other workstation without issues, but cannot start any class with main method and IDEA says:
1IntelliJ IDEA 2021.2 (Ultimate Edition)
2Build #IU-212.4746.92, built on July 27, 2021
3Licensed to XXXXXX
4Subscription is active until August 15, 2021.
5Runtime version: 11.0.11+9-b1504.13 amd64
6VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
7Linux 5.4.0-80-generic
8GC: G1 Young Generation, G1 Old Generation
9Memory: 2048M
10Cores: 3
11
12Kotlin: 212-1.5.10-release-IJ4746.92
13Current Desktop: X-Cinnamon
14Abnormal build process termination:
15/usr/lib/jvm/java-1.8.0-openjdk-amd64/bin/java -Xmx700m -Djava.awt.headless=true -Djava.endorsed.dirs=\"\" -Dcompile.parallel=false -Drebuild.on.dependency.change=true -Djdt.compiler.useSingleThread=true -Daether.connector.resumeDownloads=false -Dio.netty.initialSeedUniquifier=-5972351880001011455 -Dfile.encoding=UTF-8 -Duser.language=en -Duser.country=US -Didea.paths.selector=IntelliJIdea2021.2 -Didea.home.path=/home/pm/idea-IU-212.4746.92 -Didea.config.path=/home/pm/.config/JetBrains/IntelliJIdea2021.2 -Didea.plugins.path=/home/pm/.local/share/JetBrains/IntelliJIdea2021.2 -Djps.log.dir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/log/build-log -Djps.fallback.jdk.home=/home/pm/idea-IU-212.4746.92/jbr -Djps.fallback.jdk.version=11.0.11 -Dio.netty.noUnsafe=true -Djava.io.tmpdir=/home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server/rfg-survey-api_cc70fc05/_temp_ -Djps.backward.ref.index.builder=true -Djps.track.ap.dependencies=false --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.model=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED --add-opens=jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED -Dtmh.instrument.annotations=true -Dtmh.generate.line.numbers=true -Dkotlin.incremental.compilation=true -Dkotlin.incremental.compilation.js=true -Dkotlin.daemon.enabled -Dkotlin.daemon.client.alive.path=\"/tmp/kotlin-idea-12426594439704512301-is-running\" -classpath /home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-launcher.jar:/usr/lib/jvm/java-1.8.0-openjdk-amd64/lib/tools.jar org.jetbrains.jps.cmdline.Launcher /home/pm/idea-IU-212.4746.92/lib/slf4j.jar:/home/pm/idea-IU-212.4746.92/lib/idea_rt.jar:/home/pm/idea-IU-212.4746.92/lib/platform-api.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-file-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/forms_rt.jar:/home/pm/idea-IU-212.4746.92/lib/util.jar:/home/pm/idea-IU-212.4746.92/lib/annotations.jar:/home/pm/idea-IU-212.4746.92/lib/3rd-party.jar:/home/pm/idea-IU-212.4746.92/lib/kotlin-stdlib-jdk8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-connector-basic-1.3.3.jar:/home/pm/idea-IU-212.4746.92/lib/jna-platform.jar:/home/pm/idea-IU-212.4746.92/lib/protobuf-java-3.15.8.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders-6.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/javac2.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/aether-dependency-resolver.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-builders.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/jps-javac-extension-1.jar:/home/pm/idea-IU-212.4746.92/lib/jna.jar:/home/pm/idea-IU-212.4746.92/lib/jps-model.jar:/home/pm/idea-IU-212.4746.92/plugins/java/lib/maven-resolver-transport-http-1.3.3.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/jasper-v2-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-reflect.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/ant/lib/ant-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/uiDesigner/lib/jps/java-guiForms-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/eclipse/lib/eclipse-common.jar:/home/pm/idea-IU-212.4746.92/plugins/IntelliLang/lib/java-langInjection-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Groovy/lib/groovy-constants-rt.jar:/home/pm/idea-IU-212.4746.92/plugins/maven/lib/maven-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/gradle-java/lib/gradle-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/devkit/lib/devkit-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/javaFX/lib/javaFX-common.jar:/home/pm/idea-IU-212.4746.92/plugins/JavaEE/lib/javaee-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/webSphereIntegration/lib/jps/javaee-appServers-websphere-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/weblogicIntegration/lib/jps/javaee-appServers-weblogic-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/JPA/lib/jps/javaee-jpa-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-jps.jar:/home/pm/idea-IU-212.4746.92/plugins/Grails/lib/groovy-grails-compilerPatch.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/jps/kotlin-jps-plugin.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-jps-common.jar:/home/pm/idea-IU-212.4746.92/plugins/Kotlin/lib/kotlin-common.jar org.jetbrains.jps.cmdline.BuildMain 127.0.0.1 34781 9f0681bb-da2a-48db-8344-900ddeb29804 /home/pm/.cache/JetBrains/IntelliJIdea2021.2/compile-server
16Unrecognized option: --add-opens=jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED
17Error: Could not create the Java Virtual Machine.
18Error: A fatal exception has occurred. Program will exit.
19
I found other comment to check Lombok works and I see it is fine.
How to fix the problem?
ANSWER
Answered 2021-Jul-28 at 07:22You are running the project via Java 1.8 and add the --add-opens
option to the runner. However Java 1.8 does not support it.
So, the first option is to use Java 11 to run the project, as Java 11 can recognize this VM option.
Another solution is to find a place where --add-opens
is added and remove it.
Check Run configuration in IntelliJ IDEA (VM options field) and Maven/Gradle configuration files for argLine
(Maven) and jvmArgs
(Gradle)
QUESTION
Components not included in Strapi api response
Asked 2022-Mar-19 at 16:49I decided today that I'm going to use Strapi as my headless CMS for my portfolio, I've bumped into some issues though, which I just seem to not be able to find a solution to online. Maybe I'm just too clueless to actually find the real issue.
I have set up a schema for my projects that will be stored in Strapi (everything done in the web), but I've had some issues with my custom components, and that is, they are not part of the API responses when I run it through Postman. (Not just empty keys but not included in the response at all). All other fields, that are not components, are filled out as expected.
At first I thought it might have to do with the permissions, but everything is enabled so it can't be that, I also tried looking into the API in the code, but that logging the answer there didn't include the components either.
Here is an image of some of the fields in the schema, but more importantly the components that are not included in the response.
So my question is, do I need to create some sort of a parser or anything in the project to be able to include these fields, or why are they not included?
ANSWER
Answered 2021-Dec-06 at 20:22I had the same problem and was able to fix it by adding populate=* to the end of the API endpoint.
For example:
1http://localhost:1337/api/test?populate=*
2
More info here: https://forum.strapi.io/t/cannot-see-media-field-in-my-endpoint-for-my-content-type/13082/2
edit: Only first-level relations are populated with populate=* . Use the LHS bracket syntax (i.e. [populate]=*) to populate deeper:
For example:
1http://localhost:1337/api/test?populate=*
2http://localhost:1337/api/test?populate[TestExamples][populate]=*
3
More info here if you go to Relations population: https://docs.strapi.io/developer-docs/latest/developer-resources/database-apis-reference/rest-api.html#fields-selection
QUESTION
ESlint - Error: Must use import to load ES Module
Asked 2022-Mar-17 at 12:13I am currently setting up a boilerplate with React, Typescript, styled components, webpack etc. and I am getting an error when trying to run eslint:
Error: Must use import to load ES Module
Here is a more verbose version of the error:
1/Users/ben/Desktop/development projects/react-boilerplate-styled-context/src/api/api.ts
2 0:0 error Parsing error: Must use import to load ES Module: /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js
3require() of ES modules is not supported.
4require() of /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/babel-eslint/lib/require-from-eslint.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
5Instead rename definition.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/package.json
6
The error occurs in every single one of my .js and .ts/ .tsx files where I only use import
or the file doesn't even have an import at all. I understand what the error is saying but I have no idea why it is being thrown when in fact I only use imports or even no imports at all in some files.
Here is my package.json where I trigger the linter from using npm run lint:eslint:quiet
:
1/Users/ben/Desktop/development projects/react-boilerplate-styled-context/src/api/api.ts
2 0:0 error Parsing error: Must use import to load ES Module: /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js
3require() of ES modules is not supported.
4require() of /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/babel-eslint/lib/require-from-eslint.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
5Instead rename definition.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/package.json
6{
7 "name": "my-react-boilerplate",
8 "version": "1.0.0",
9 "description": "",
10 "main": "index.tsx",
11 "directories": {
12 "test": "test"
13 },
14 "engines": {
15 "node": ">=14.0.0"
16 },
17 "type": "module",
18 "scripts": {
19 "build": "webpack --config webpack.prod.js",
20 "dev": "webpack serve --config webpack.dev.js",
21 "lint": "npm run typecheck && npm run lint:css && npm run lint:eslint:quiet",
22 "lint:css": "stylelint './src/**/*.{js,ts,tsx}'",
23 "lint:eslint:quiet": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern --quiet",
24 "lint:eslint": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern",
25 "lint:eslint:fix": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern --quiet --fix",
26 "test": "cross-env NODE_ENV=test jest --coverage",
27 "test:watch": "cross-env NODE_ENV=test jest --watchAll",
28 "typecheck": "tsc --noEmit",
29 "precommit": "npm run lint"
30 },
31 "lint-staged": {
32 "*.{ts,tsx,js,jsx}": [
33 "npm run lint:eslint:fix",
34 "git add --force"
35 ],
36 "*.{md,json}": [
37 "prettier --write",
38 "git add --force"
39 ]
40 },
41 "husky": {
42 "hooks": {
43 "pre-commit": "npx lint-staged && npm run typecheck"
44 }
45 },
46 "resolutions": {
47 "styled-components": "^5"
48 },
49 "author": "",
50 "license": "ISC",
51 "devDependencies": {
52 "@babel/core": "^7.5.4",
53 "@babel/plugin-proposal-class-properties": "^7.5.0",
54 "@babel/preset-env": "^7.5.4",
55 "@babel/preset-react": "^7.0.0",
56 "@types/history": "^4.7.6",
57 "@types/react": "^17.0.29",
58 "@types/react-dom": "^17.0.9",
59 "@types/react-router": "^5.1.17",
60 "@types/react-router-dom": "^5.1.5",
61 "@types/styled-components": "^5.1.15",
62 "@typescript-eslint/eslint-plugin": "^5.0.0",
63 "babel-cli": "^6.26.0",
64 "babel-eslint": "^10.0.2",
65 "babel-loader": "^8.0.0-beta.6",
66 "babel-polyfill": "^6.26.0",
67 "babel-preset-env": "^1.7.0",
68 "babel-preset-react": "^6.24.1",
69 "babel-preset-stage-2": "^6.24.1",
70 "clean-webpack-plugin": "^4.0.0",
71 "dotenv-webpack": "^7.0.3",
72 "error-overlay-webpack-plugin": "^1.0.0",
73 "eslint": "^8.0.0",
74 "eslint-config-airbnb": "^18.2.0",
75 "eslint-config-prettier": "^8.3.0",
76 "eslint-config-with-prettier": "^6.0.0",
77 "eslint-plugin-compat": "^3.3.0",
78 "eslint-plugin-import": "^2.25.2",
79 "eslint-plugin-jsx-a11y": "^6.2.3",
80 "eslint-plugin-prettier": "^4.0.0",
81 "eslint-plugin-react": "^7.14.2",
82 "eslint-plugin-react-hooks": "^4.2.0",
83 "extract-text-webpack-plugin": "^3.0.2",
84 "file-loader": "^6.2.0",
85 "html-webpack-plugin": "^5.3.2",
86 "husky": "^7.0.2",
87 "prettier": "^2.4.1",
88 "raw-loader": "^4.0.2",
89 "style-loader": "^3.3.0",
90 "stylelint": "^13.13.1",
91 "stylelint-config-recommended": "^5.0.0",
92 "stylelint-config-styled-components": "^0.1.1",
93 "stylelint-processor-styled-components": "^1.10.0",
94 "ts-loader": "^9.2.6",
95 "tslint": "^6.1.3",
96 "typescript": "^4.4.4",
97 "url-loader": "^4.1.1",
98 "webpack": "^5.58.2",
99 "webpack-cli": "^4.2.0",
100 "webpack-dev-server": "^4.3.1",
101 "webpack-merge": "^5.3.0"
102 },
103 "dependencies": {
104 "history": "^4.10.0",
105 "process": "^0.11.10",
106 "react": "^17.0.1",
107 "react-dom": "^17.0.1",
108 "react-router-dom": "^5.2.0",
109 "styled-components": "^5.2.1"
110 }
111}
112
Here is my .eslintrc file:
1/Users/ben/Desktop/development projects/react-boilerplate-styled-context/src/api/api.ts
2 0:0 error Parsing error: Must use import to load ES Module: /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js
3require() of ES modules is not supported.
4require() of /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/babel-eslint/lib/require-from-eslint.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
5Instead rename definition.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/package.json
6{
7 "name": "my-react-boilerplate",
8 "version": "1.0.0",
9 "description": "",
10 "main": "index.tsx",
11 "directories": {
12 "test": "test"
13 },
14 "engines": {
15 "node": ">=14.0.0"
16 },
17 "type": "module",
18 "scripts": {
19 "build": "webpack --config webpack.prod.js",
20 "dev": "webpack serve --config webpack.dev.js",
21 "lint": "npm run typecheck && npm run lint:css && npm run lint:eslint:quiet",
22 "lint:css": "stylelint './src/**/*.{js,ts,tsx}'",
23 "lint:eslint:quiet": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern --quiet",
24 "lint:eslint": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern",
25 "lint:eslint:fix": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern --quiet --fix",
26 "test": "cross-env NODE_ENV=test jest --coverage",
27 "test:watch": "cross-env NODE_ENV=test jest --watchAll",
28 "typecheck": "tsc --noEmit",
29 "precommit": "npm run lint"
30 },
31 "lint-staged": {
32 "*.{ts,tsx,js,jsx}": [
33 "npm run lint:eslint:fix",
34 "git add --force"
35 ],
36 "*.{md,json}": [
37 "prettier --write",
38 "git add --force"
39 ]
40 },
41 "husky": {
42 "hooks": {
43 "pre-commit": "npx lint-staged && npm run typecheck"
44 }
45 },
46 "resolutions": {
47 "styled-components": "^5"
48 },
49 "author": "",
50 "license": "ISC",
51 "devDependencies": {
52 "@babel/core": "^7.5.4",
53 "@babel/plugin-proposal-class-properties": "^7.5.0",
54 "@babel/preset-env": "^7.5.4",
55 "@babel/preset-react": "^7.0.0",
56 "@types/history": "^4.7.6",
57 "@types/react": "^17.0.29",
58 "@types/react-dom": "^17.0.9",
59 "@types/react-router": "^5.1.17",
60 "@types/react-router-dom": "^5.1.5",
61 "@types/styled-components": "^5.1.15",
62 "@typescript-eslint/eslint-plugin": "^5.0.0",
63 "babel-cli": "^6.26.0",
64 "babel-eslint": "^10.0.2",
65 "babel-loader": "^8.0.0-beta.6",
66 "babel-polyfill": "^6.26.0",
67 "babel-preset-env": "^1.7.0",
68 "babel-preset-react": "^6.24.1",
69 "babel-preset-stage-2": "^6.24.1",
70 "clean-webpack-plugin": "^4.0.0",
71 "dotenv-webpack": "^7.0.3",
72 "error-overlay-webpack-plugin": "^1.0.0",
73 "eslint": "^8.0.0",
74 "eslint-config-airbnb": "^18.2.0",
75 "eslint-config-prettier": "^8.3.0",
76 "eslint-config-with-prettier": "^6.0.0",
77 "eslint-plugin-compat": "^3.3.0",
78 "eslint-plugin-import": "^2.25.2",
79 "eslint-plugin-jsx-a11y": "^6.2.3",
80 "eslint-plugin-prettier": "^4.0.0",
81 "eslint-plugin-react": "^7.14.2",
82 "eslint-plugin-react-hooks": "^4.2.0",
83 "extract-text-webpack-plugin": "^3.0.2",
84 "file-loader": "^6.2.0",
85 "html-webpack-plugin": "^5.3.2",
86 "husky": "^7.0.2",
87 "prettier": "^2.4.1",
88 "raw-loader": "^4.0.2",
89 "style-loader": "^3.3.0",
90 "stylelint": "^13.13.1",
91 "stylelint-config-recommended": "^5.0.0",
92 "stylelint-config-styled-components": "^0.1.1",
93 "stylelint-processor-styled-components": "^1.10.0",
94 "ts-loader": "^9.2.6",
95 "tslint": "^6.1.3",
96 "typescript": "^4.4.4",
97 "url-loader": "^4.1.1",
98 "webpack": "^5.58.2",
99 "webpack-cli": "^4.2.0",
100 "webpack-dev-server": "^4.3.1",
101 "webpack-merge": "^5.3.0"
102 },
103 "dependencies": {
104 "history": "^4.10.0",
105 "process": "^0.11.10",
106 "react": "^17.0.1",
107 "react-dom": "^17.0.1",
108 "react-router-dom": "^5.2.0",
109 "styled-components": "^5.2.1"
110 }
111}
112{
113 "extends": ["airbnb", "prettier"],
114 "parser": "babel-eslint",
115 "plugins": ["prettier", "@typescript-eslint"],
116 "parserOptions": {
117 "ecmaVersion": 8,
118 "ecmaFeatures": {
119 "experimentalObjectRestSpread": true,
120 "impliedStrict": true,
121 "classes": true
122 }
123 },
124 "env": {
125 "browser": true,
126 "node": true,
127 "jest": true
128 },
129 "rules": {
130 "arrow-body-style": ["error", "as-needed"],
131 "class-methods-use-this": 0,
132 "react/jsx-filename-extension": 0,
133 "global-require": 0,
134 "react/destructuring-assignment": 0,
135 "import/named": 2,
136 "linebreak-style": 0,
137 "import/no-dynamic-require": 0,
138 "import/no-named-as-default": 0,
139 "import/no-unresolved": 2,
140 "import/prefer-default-export": 0,
141 "semi": [2, "always"],
142 "max-len": [
143 "error",
144 {
145 "code": 80,
146 "ignoreUrls": true,
147 "ignoreComments": true,
148 "ignoreStrings": true,
149 "ignoreTemplateLiterals": true
150 }
151 ],
152 "new-cap": [
153 2,
154 {
155 "capIsNew": false,
156 "newIsCap": true
157 }
158 ],
159 "no-param-reassign": 0,
160 "no-shadow": 0,
161 "no-tabs": 2,
162 "no-underscore-dangle": 0,
163 "react/forbid-prop-types": [
164 "error",
165 {
166 "forbid": ["any"]
167 }
168 ],
169 "import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
170 "react/jsx-no-bind": [
171 "error",
172 {
173 "ignoreRefs": true,
174 "allowArrowFunctions": true,
175 "allowBind": false
176 }
177 ],
178 "react/no-unknown-property": [
179 2,
180 {
181 "ignore": ["itemscope", "itemtype", "itemprop"]
182 }
183 ]
184 }
185}
186
And i'm not sure if relevant but also my tsconfig.eslint.json file:
1/Users/ben/Desktop/development projects/react-boilerplate-styled-context/src/api/api.ts
2 0:0 error Parsing error: Must use import to load ES Module: /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js
3require() of ES modules is not supported.
4require() of /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/lib/definition.js from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/babel-eslint/lib/require-from-eslint.js is an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which defines all .js files in that package scope as ES modules.
5Instead rename definition.js to end in .cjs, change the requiring code to use import(), or remove "type": "module" from /Users/ben/Desktop/development projects/react-boilerplate-styled-context/node_modules/eslint/node_modules/eslint-scope/package.json
6{
7 "name": "my-react-boilerplate",
8 "version": "1.0.0",
9 "description": "",
10 "main": "index.tsx",
11 "directories": {
12 "test": "test"
13 },
14 "engines": {
15 "node": ">=14.0.0"
16 },
17 "type": "module",
18 "scripts": {
19 "build": "webpack --config webpack.prod.js",
20 "dev": "webpack serve --config webpack.dev.js",
21 "lint": "npm run typecheck && npm run lint:css && npm run lint:eslint:quiet",
22 "lint:css": "stylelint './src/**/*.{js,ts,tsx}'",
23 "lint:eslint:quiet": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern --quiet",
24 "lint:eslint": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern",
25 "lint:eslint:fix": "eslint --ext .ts,.tsx,.js,.jsx ./src --no-error-on-unmatched-pattern --quiet --fix",
26 "test": "cross-env NODE_ENV=test jest --coverage",
27 "test:watch": "cross-env NODE_ENV=test jest --watchAll",
28 "typecheck": "tsc --noEmit",
29 "precommit": "npm run lint"
30 },
31 "lint-staged": {
32 "*.{ts,tsx,js,jsx}": [
33 "npm run lint:eslint:fix",
34 "git add --force"
35 ],
36 "*.{md,json}": [
37 "prettier --write",
38 "git add --force"
39 ]
40 },
41 "husky": {
42 "hooks": {
43 "pre-commit": "npx lint-staged && npm run typecheck"
44 }
45 },
46 "resolutions": {
47 "styled-components": "^5"
48 },
49 "author": "",
50 "license": "ISC",
51 "devDependencies": {
52 "@babel/core": "^7.5.4",
53 "@babel/plugin-proposal-class-properties": "^7.5.0",
54 "@babel/preset-env": "^7.5.4",
55 "@babel/preset-react": "^7.0.0",
56 "@types/history": "^4.7.6",
57 "@types/react": "^17.0.29",
58 "@types/react-dom": "^17.0.9",
59 "@types/react-router": "^5.1.17",
60 "@types/react-router-dom": "^5.1.5",
61 "@types/styled-components": "^5.1.15",
62 "@typescript-eslint/eslint-plugin": "^5.0.0",
63 "babel-cli": "^6.26.0",
64 "babel-eslint": "^10.0.2",
65 "babel-loader": "^8.0.0-beta.6",
66 "babel-polyfill": "^6.26.0",
67 "babel-preset-env": "^1.7.0",
68 "babel-preset-react": "^6.24.1",
69 "babel-preset-stage-2": "^6.24.1",
70 "clean-webpack-plugin": "^4.0.0",
71 "dotenv-webpack": "^7.0.3",
72 "error-overlay-webpack-plugin": "^1.0.0",
73 "eslint": "^8.0.0",
74 "eslint-config-airbnb": "^18.2.0",
75 "eslint-config-prettier": "^8.3.0",
76 "eslint-config-with-prettier": "^6.0.0",
77 "eslint-plugin-compat": "^3.3.0",
78 "eslint-plugin-import": "^2.25.2",
79 "eslint-plugin-jsx-a11y": "^6.2.3",
80 "eslint-plugin-prettier": "^4.0.0",
81 "eslint-plugin-react": "^7.14.2",
82 "eslint-plugin-react-hooks": "^4.2.0",
83 "extract-text-webpack-plugin": "^3.0.2",
84 "file-loader": "^6.2.0",
85 "html-webpack-plugin": "^5.3.2",
86 "husky": "^7.0.2",
87 "prettier": "^2.4.1",
88 "raw-loader": "^4.0.2",
89 "style-loader": "^3.3.0",
90 "stylelint": "^13.13.1",
91 "stylelint-config-recommended": "^5.0.0",
92 "stylelint-config-styled-components": "^0.1.1",
93 "stylelint-processor-styled-components": "^1.10.0",
94 "ts-loader": "^9.2.6",
95 "tslint": "^6.1.3",
96 "typescript": "^4.4.4",
97 "url-loader": "^4.1.1",
98 "webpack": "^5.58.2",
99 "webpack-cli": "^4.2.0",
100 "webpack-dev-server": "^4.3.1",
101 "webpack-merge": "^5.3.0"
102 },
103 "dependencies": {
104 "history": "^4.10.0",
105 "process": "^0.11.10",
106 "react": "^17.0.1",
107 "react-dom": "^17.0.1",
108 "react-router-dom": "^5.2.0",
109 "styled-components": "^5.2.1"
110 }
111}
112{
113 "extends": ["airbnb", "prettier"],
114 "parser": "babel-eslint",
115 "plugins": ["prettier", "@typescript-eslint"],
116 "parserOptions": {
117 "ecmaVersion": 8,
118 "ecmaFeatures": {
119 "experimentalObjectRestSpread": true,
120 "impliedStrict": true,
121 "classes": true
122 }
123 },
124 "env": {
125 "browser": true,
126 "node": true,
127 "jest": true
128 },
129 "rules": {
130 "arrow-body-style": ["error", "as-needed"],
131 "class-methods-use-this": 0,
132 "react/jsx-filename-extension": 0,
133 "global-require": 0,
134 "react/destructuring-assignment": 0,
135 "import/named": 2,
136 "linebreak-style": 0,
137 "import/no-dynamic-require": 0,
138 "import/no-named-as-default": 0,
139 "import/no-unresolved": 2,
140 "import/prefer-default-export": 0,
141 "semi": [2, "always"],
142 "max-len": [
143 "error",
144 {
145 "code": 80,
146 "ignoreUrls": true,
147 "ignoreComments": true,
148 "ignoreStrings": true,
149 "ignoreTemplateLiterals": true
150 }
151 ],
152 "new-cap": [
153 2,
154 {
155 "capIsNew": false,
156 "newIsCap": true
157 }
158 ],
159 "no-param-reassign": 0,
160 "no-shadow": 0,
161 "no-tabs": 2,
162 "no-underscore-dangle": 0,
163 "react/forbid-prop-types": [
164 "error",
165 {
166 "forbid": ["any"]
167 }
168 ],
169 "import/no-extraneous-dependencies": ["error", { "devDependencies": true }],
170 "react/jsx-no-bind": [
171 "error",
172 {
173 "ignoreRefs": true,
174 "allowArrowFunctions": true,
175 "allowBind": false
176 }
177 ],
178 "react/no-unknown-property": [
179 2,
180 {
181 "ignore": ["itemscope", "itemtype", "itemprop"]
182 }
183 ]
184 }
185}
186{
187 "extends": "./tsconfig.json",
188 "include": ["./src/**/*.ts", "./src/**/*.tsx", "./src/**/*.js"],
189 "exclude": ["node_modules/**", "build/**", "coverage/**"]
190}
191
Not sure if anyone has come across this before? Googling the error does not present any useful forums or raised bugs, most of them just state not to use require
in your files which I am not.
ANSWER
Answered 2022-Mar-15 at 16:08I think the problem is that you are trying to use the deprecated babel-eslint parser, last updated a year ago, which looks like it doesn't support ES6 modules. Updating to the latest parser seems to work, at least for simple linting.
So, do this:
- In package.json, update the line
"babel-eslint": "^10.0.2",
to"@babel/eslint-parser": "^7.5.4",
. This works with the code above but it may be better to use the latest version, which at the time of writing is 7.16.3. - Run
npm i
from a terminal/command prompt in the folder - In .eslintrc, update the parser line
"parser": "babel-eslint",
to"parser": "@babel/eslint-parser",
- In .eslintrc, add
"requireConfigFile": false,
to the parserOptions section (underneath"ecmaVersion": 8,
) (I needed this or babel was looking for config files I don't have) - Run the command to lint a file
Then, for me with just your two configuration files, the error goes away and I get appropriate linting errors.
QUESTION
ESLint Definition for rule 'import/extensions' was not found
Asked 2022-Feb-14 at 08:36I'm getting the following two errors on all TypeScript files using ESLint in VS Code:
1Definition for rule 'import/extensions' was not found.eslint(import/extensions)
2Definition for rule 'import/no-extraneous-dependencies' was not found.eslint(import/no-extraneous-dependencies)
3
A screenshot from VSC Problems pane:
Note on possible duplicatesThere are many similar questions about different modules and even some about the import/extensions
, but none of the suggested solutions help. I've tried them all. I also tried every single solution posted in every single thread suggested by Stack Overflow while typing this question.
Here is my .eslintrc.json
:
1Definition for rule 'import/extensions' was not found.eslint(import/extensions)
2Definition for rule 'import/no-extraneous-dependencies' was not found.eslint(import/no-extraneous-dependencies)
3{
4 "env": {
5 "es2021": true,
6 "node": true
7 },
8 "extends": [
9 "airbnb-typescript/base",
10 "plugin:@typescript-eslint/recommended"
11 ],
12 "parser": "@typescript-eslint/parser",
13 "parserOptions": {
14 "ecmaVersion": 12,
15 "sourceType": "module",
16 "project": "./tsconfig.json"
17 },
18 "plugins": [
19 "@typescript-eslint"
20 ],
21 "rules": {
22 "@typescript-eslint/no-use-before-define": "off"
23 }
24}
25
package.json
:
1Definition for rule 'import/extensions' was not found.eslint(import/extensions)
2Definition for rule 'import/no-extraneous-dependencies' was not found.eslint(import/no-extraneous-dependencies)
3{
4 "env": {
5 "es2021": true,
6 "node": true
7 },
8 "extends": [
9 "airbnb-typescript/base",
10 "plugin:@typescript-eslint/recommended"
11 ],
12 "parser": "@typescript-eslint/parser",
13 "parserOptions": {
14 "ecmaVersion": 12,
15 "sourceType": "module",
16 "project": "./tsconfig.json"
17 },
18 "plugins": [
19 "@typescript-eslint"
20 ],
21 "rules": {
22 "@typescript-eslint/no-use-before-define": "off"
23 }
24}
25{
26 "name": "graph-userdata-gateway",
27 "version": "1.0.0",
28 "description": "Gateway for PowerApps Microsoft Graph API custom connector to query user data with application permissions.",
29 "main": "src/index.js",
30 "scripts": {
31 "test": "echo \"Error: no test specified\" && exit 1"
32 },
33 "repository": {
34 "type": "git",
35 "url": "git@gitlab.yobitti.fi:powerapps/graph-userdata-gateway.git"
36 },
37 "author": "Benjamin Pettinen / YO-bitti Oy",
38 "license": "UNLICENSED",
39 "dependencies": {
40 "@microsoft/microsoft-graph-client": "^3.0.0",
41 "dedent": "^0.7.0",
42 "express": "^4.17.1",
43 "isomorphic-fetch": "^3.0.0",
44 "md5": "^2.3.0",
45 "node-fetch": "^2.6.1"
46 },
47 "devDependencies": {
48 "@types/dedent": "^0.7.0",
49 "@types/express": "^4.17.13",
50 "@types/isomorphic-fetch": "0.0.35",
51 "@types/md5": "^2.3.1",
52 "@types/node-fetch": "^2.5.12",
53 "@typescript-eslint/eslint-plugin": "^4.29.2",
54 "@typescript-eslint/parser": "^4.29.2",
55 "eslint": "^7.32.0",
56 "eslint-config-airbnb-base": "^14.2.1",
57 "eslint-config-airbnb-typescript": "^13.0.0",
58 "eslint-plugin-import": "^2.24.1",
59 "typescript": "^4.3.5"
60 }
61}
62
tsconfig.json
1Definition for rule 'import/extensions' was not found.eslint(import/extensions)
2Definition for rule 'import/no-extraneous-dependencies' was not found.eslint(import/no-extraneous-dependencies)
3{
4 "env": {
5 "es2021": true,
6 "node": true
7 },
8 "extends": [
9 "airbnb-typescript/base",
10 "plugin:@typescript-eslint/recommended"
11 ],
12 "parser": "@typescript-eslint/parser",
13 "parserOptions": {
14 "ecmaVersion": 12,
15 "sourceType": "module",
16 "project": "./tsconfig.json"
17 },
18 "plugins": [
19 "@typescript-eslint"
20 ],
21 "rules": {
22 "@typescript-eslint/no-use-before-define": "off"
23 }
24}
25{
26 "name": "graph-userdata-gateway",
27 "version": "1.0.0",
28 "description": "Gateway for PowerApps Microsoft Graph API custom connector to query user data with application permissions.",
29 "main": "src/index.js",
30 "scripts": {
31 "test": "echo \"Error: no test specified\" && exit 1"
32 },
33 "repository": {
34 "type": "git",
35 "url": "git@gitlab.yobitti.fi:powerapps/graph-userdata-gateway.git"
36 },
37 "author": "Benjamin Pettinen / YO-bitti Oy",
38 "license": "UNLICENSED",
39 "dependencies": {
40 "@microsoft/microsoft-graph-client": "^3.0.0",
41 "dedent": "^0.7.0",
42 "express": "^4.17.1",
43 "isomorphic-fetch": "^3.0.0",
44 "md5": "^2.3.0",
45 "node-fetch": "^2.6.1"
46 },
47 "devDependencies": {
48 "@types/dedent": "^0.7.0",
49 "@types/express": "^4.17.13",
50 "@types/isomorphic-fetch": "0.0.35",
51 "@types/md5": "^2.3.1",
52 "@types/node-fetch": "^2.5.12",
53 "@typescript-eslint/eslint-plugin": "^4.29.2",
54 "@typescript-eslint/parser": "^4.29.2",
55 "eslint": "^7.32.0",
56 "eslint-config-airbnb-base": "^14.2.1",
57 "eslint-config-airbnb-typescript": "^13.0.0",
58 "eslint-plugin-import": "^2.24.1",
59 "typescript": "^4.3.5"
60 }
61}
62{
63 "compilerOptions": {
64 "target": "ES6",
65 "module": "CommonJS",
66 "esModuleInterop": true,
67 "noImplicitAny": true,
68 "moduleResolution": "Node",
69 "outDir": "dist",
70 "sourceMap": true
71 }
72}
73
I've tried deleting the whole node_mobules
and re-running npm install
as well as played with the extends
in the .eslintrc.json
. If I remove airbnb-typescript/base
the error disappears, but I lose the Airbnb style from ESLint. Using airbnb-base
instead works, but then ESLint complains about Missing file extension for abc.ts
and Unable to resolve path to module abc
. I have also multiple time restarted VSC and the ESLint server.
ANSWER
Answered 2021-Dec-14 at 12:09You missed adding this in your eslint.json
file.
1Definition for rule 'import/extensions' was not found.eslint(import/extensions)
2Definition for rule 'import/no-extraneous-dependencies' was not found.eslint(import/no-extraneous-dependencies)
3{
4 "env": {
5 "es2021": true,
6 "node": true
7 },
8 "extends": [
9 "airbnb-typescript/base",
10 "plugin:@typescript-eslint/recommended"
11 ],
12 "parser": "@typescript-eslint/parser",
13 "parserOptions": {
14 "ecmaVersion": 12,
15 "sourceType": "module",
16 "project": "./tsconfig.json"
17 },
18 "plugins": [
19 "@typescript-eslint"
20 ],
21 "rules": {
22 "@typescript-eslint/no-use-before-define": "off"
23 }
24}
25{
26 "name": "graph-userdata-gateway",
27 "version": "1.0.0",
28 "description": "Gateway for PowerApps Microsoft Graph API custom connector to query user data with application permissions.",
29 "main": "src/index.js",
30 "scripts": {
31 "test": "echo \"Error: no test specified\" && exit 1"
32 },
33 "repository": {
34 "type": "git",
35 "url": "git@gitlab.yobitti.fi:powerapps/graph-userdata-gateway.git"
36 },
37 "author": "Benjamin Pettinen / YO-bitti Oy",
38 "license": "UNLICENSED",
39 "dependencies": {
40 "@microsoft/microsoft-graph-client": "^3.0.0",
41 "dedent": "^0.7.0",
42 "express": "^4.17.1",
43 "isomorphic-fetch": "^3.0.0",
44 "md5": "^2.3.0",
45 "node-fetch": "^2.6.1"
46 },
47 "devDependencies": {
48 "@types/dedent": "^0.7.0",
49 "@types/express": "^4.17.13",
50 "@types/isomorphic-fetch": "0.0.35",
51 "@types/md5": "^2.3.1",
52 "@types/node-fetch": "^2.5.12",
53 "@typescript-eslint/eslint-plugin": "^4.29.2",
54 "@typescript-eslint/parser": "^4.29.2",
55 "eslint": "^7.32.0",
56 "eslint-config-airbnb-base": "^14.2.1",
57 "eslint-config-airbnb-typescript": "^13.0.0",
58 "eslint-plugin-import": "^2.24.1",
59 "typescript": "^4.3.5"
60 }
61}
62{
63 "compilerOptions": {
64 "target": "ES6",
65 "module": "CommonJS",
66 "esModuleInterop": true,
67 "noImplicitAny": true,
68 "moduleResolution": "Node",
69 "outDir": "dist",
70 "sourceMap": true
71 }
72}
73"plugins": ["import"],
74
Or,
1Definition for rule 'import/extensions' was not found.eslint(import/extensions)
2Definition for rule 'import/no-extraneous-dependencies' was not found.eslint(import/no-extraneous-dependencies)
3{
4 "env": {
5 "es2021": true,
6 "node": true
7 },
8 "extends": [
9 "airbnb-typescript/base",
10 "plugin:@typescript-eslint/recommended"
11 ],
12 "parser": "@typescript-eslint/parser",
13 "parserOptions": {
14 "ecmaVersion": 12,
15 "sourceType": "module",
16 "project": "./tsconfig.json"
17 },
18 "plugins": [
19 "@typescript-eslint"
20 ],
21 "rules": {
22 "@typescript-eslint/no-use-before-define": "off"
23 }
24}
25{
26 "name": "graph-userdata-gateway",
27 "version": "1.0.0",
28 "description": "Gateway for PowerApps Microsoft Graph API custom connector to query user data with application permissions.",
29 "main": "src/index.js",
30 "scripts": {
31 "test": "echo \"Error: no test specified\" && exit 1"
32 },
33 "repository": {
34 "type": "git",
35 "url": "git@gitlab.yobitti.fi:powerapps/graph-userdata-gateway.git"
36 },
37 "author": "Benjamin Pettinen / YO-bitti Oy",
38 "license": "UNLICENSED",
39 "dependencies": {
40 "@microsoft/microsoft-graph-client": "^3.0.0",
41 "dedent": "^0.7.0",
42 "express": "^4.17.1",
43 "isomorphic-fetch": "^3.0.0",
44 "md5": "^2.3.0",
45 "node-fetch": "^2.6.1"
46 },
47 "devDependencies": {
48 "@types/dedent": "^0.7.0",
49 "@types/express": "^4.17.13",
50 "@types/isomorphic-fetch": "0.0.35",
51 "@types/md5": "^2.3.1",
52 "@types/node-fetch": "^2.5.12",
53 "@typescript-eslint/eslint-plugin": "^4.29.2",
54 "@typescript-eslint/parser": "^4.29.2",
55 "eslint": "^7.32.0",
56 "eslint-config-airbnb-base": "^14.2.1",
57 "eslint-config-airbnb-typescript": "^13.0.0",
58 "eslint-plugin-import": "^2.24.1",
59 "typescript": "^4.3.5"
60 }
61}
62{
63 "compilerOptions": {
64 "target": "ES6",
65 "module": "CommonJS",
66 "esModuleInterop": true,
67 "noImplicitAny": true,
68 "moduleResolution": "Node",
69 "outDir": "dist",
70 "sourceMap": true
71 }
72}
73"plugins": ["import"],
74"extends": ["plugin:import/recommended"]
75
QUESTION
How to fix: "@angular/fire"' has no exported member 'AngularFireModule'.ts(2305) ionic, firebase, angular
Asked 2022-Feb-11 at 07:31I'm trying to connect my app with a firebase db, but I receive 4 error messages on app.module.ts:
1'"@angular/fire"' has no exported member 'AngularFireModule'.ts(2305),
2'"@angular/fire/storage"' has no exported member 'AngularFireStorageModule'.ts(2305)
3'"@angular/fire/database"' has no exported member 'AngularFireDatabaseModule'.ts(2305)
4'"@angular/fire/auth"' has no exported member 'AngularFireAuthModule'.ts(2305)
5
here is my package.json file:
1'"@angular/fire"' has no exported member 'AngularFireModule'.ts(2305),
2'"@angular/fire/storage"' has no exported member 'AngularFireStorageModule'.ts(2305)
3'"@angular/fire/database"' has no exported member 'AngularFireDatabaseModule'.ts(2305)
4'"@angular/fire/auth"' has no exported member 'AngularFireAuthModule'.ts(2305)
5{
6 "name": "gescable",
7 "version": "0.0.1",
8 "author": "Ionic Framework",
9 "homepage": "https://ionicframework.com/",
10 "scripts": {
11 "ng": "ng",
12 "start": "ng serve",
13 "build": "ng build",
14 "test": "ng test",
15 "lint": "ng lint",
16 "e2e": "ng e2e"
17 },
18 "private": true,
19 "dependencies": {
20 "@angular-devkit/architect": "^0.1202.5",
21 "@angular-devkit/architect-cli": "^0.1202.5",
22 "@angular/common": "~12.1.1",
23 "@angular/core": "~12.1.1",
24 "@angular/fire": "^7.0.4",
25 "@angular/forms": "~12.1.1",
26 "@angular/platform-browser": "~12.1.1",
27 "@angular/platform-browser-dynamic": "~12.1.1",
28 "@angular/router": "~12.1.1",
29 "@ionic/angular": "^5.5.2",
30 "ajv": "^8.6.2",
31 "angularfire2": "^5.4.2",
32 "firebase": "^7.24.0",
33 "rxfire": "^6.0.0",
34 "rxjs": "~6.6.0",
35 "tslib": "^2.2.0",
36 "zone.js": "~0.11.4"
37 },
38 "devDependencies": {
39 "@angular-devkit/build-angular": "~12.1.1",
40 "@angular-eslint/builder": "~12.0.0",
41 "@angular-eslint/eslint-plugin": "~12.0.0",
42 "@angular-eslint/eslint-plugin-template": "~12.0.0",
43 "@angular-eslint/template-parser": "~12.0.0",
44 "@angular/cli": "~12.1.1",
45 "@angular/compiler": "~12.1.1",
46 "@angular/compiler-cli": "~12.1.1",
47 "@angular/language-service": "~12.0.1",
48 "@ionic/angular-toolkit": "^4.0.0",
49 "@types/jasmine": "~3.6.0",
50 "@types/jasminewd2": "~2.0.3",
51 "@types/node": "^12.11.1",
52 "@typescript-eslint/eslint-plugin": "4.16.1",
53 "@typescript-eslint/parser": "4.16.1",
54 "eslint": "^7.6.0",
55 "eslint-plugin-import": "2.22.1",
56 "eslint-plugin-jsdoc": "30.7.6",
57 "eslint-plugin-prefer-arrow": "1.2.2",
58 "jasmine-core": "~3.8.0",
59 "jasmine-spec-reporter": "~5.0.0",
60 "karma": "~6.3.2",
61 "karma-chrome-launcher": "~3.1.0",
62 "karma-coverage": "~2.0.3",
63 "karma-coverage-istanbul-reporter": "~3.0.2",
64 "karma-jasmine": "~4.0.0",
65 "karma-jasmine-html-reporter": "^1.5.0",
66 "protractor": "~7.0.0",
67 "ts-node": "~8.3.0",
68 "typescript": "~4.2.4",
69 "@angular-devkit/architect": "^0.1200.0",
70 "firebase-tools": "^9.0.0",
71 "fuzzy": "^0.1.3",
72 "inquirer": "^6.2.2",
73 "inquirer-autocomplete-prompt": "^1.0.1",
74 "open": "^7.0.3",
75 "jsonc-parser": "^3.0.0"
76 },
77 "description": "An Ionic project"
78}
79
And here is my app.module.ts:
1'"@angular/fire"' has no exported member 'AngularFireModule'.ts(2305),
2'"@angular/fire/storage"' has no exported member 'AngularFireStorageModule'.ts(2305)
3'"@angular/fire/database"' has no exported member 'AngularFireDatabaseModule'.ts(2305)
4'"@angular/fire/auth"' has no exported member 'AngularFireAuthModule'.ts(2305)
5{
6 "name": "gescable",
7 "version": "0.0.1",
8 "author": "Ionic Framework",
9 "homepage": "https://ionicframework.com/",
10 "scripts": {
11 "ng": "ng",
12 "start": "ng serve",
13 "build": "ng build",
14 "test": "ng test",
15 "lint": "ng lint",
16 "e2e": "ng e2e"
17 },
18 "private": true,
19 "dependencies": {
20 "@angular-devkit/architect": "^0.1202.5",
21 "@angular-devkit/architect-cli": "^0.1202.5",
22 "@angular/common": "~12.1.1",
23 "@angular/core": "~12.1.1",
24 "@angular/fire": "^7.0.4",
25 "@angular/forms": "~12.1.1",
26 "@angular/platform-browser": "~12.1.1",
27 "@angular/platform-browser-dynamic": "~12.1.1",
28 "@angular/router": "~12.1.1",
29 "@ionic/angular": "^5.5.2",
30 "ajv": "^8.6.2",
31 "angularfire2": "^5.4.2",
32 "firebase": "^7.24.0",
33 "rxfire": "^6.0.0",
34 "rxjs": "~6.6.0",
35 "tslib": "^2.2.0",
36 "zone.js": "~0.11.4"
37 },
38 "devDependencies": {
39 "@angular-devkit/build-angular": "~12.1.1",
40 "@angular-eslint/builder": "~12.0.0",
41 "@angular-eslint/eslint-plugin": "~12.0.0",
42 "@angular-eslint/eslint-plugin-template": "~12.0.0",
43 "@angular-eslint/template-parser": "~12.0.0",
44 "@angular/cli": "~12.1.1",
45 "@angular/compiler": "~12.1.1",
46 "@angular/compiler-cli": "~12.1.1",
47 "@angular/language-service": "~12.0.1",
48 "@ionic/angular-toolkit": "^4.0.0",
49 "@types/jasmine": "~3.6.0",
50 "@types/jasminewd2": "~2.0.3",
51 "@types/node": "^12.11.1",
52 "@typescript-eslint/eslint-plugin": "4.16.1",
53 "@typescript-eslint/parser": "4.16.1",
54 "eslint": "^7.6.0",
55 "eslint-plugin-import": "2.22.1",
56 "eslint-plugin-jsdoc": "30.7.6",
57 "eslint-plugin-prefer-arrow": "1.2.2",
58 "jasmine-core": "~3.8.0",
59 "jasmine-spec-reporter": "~5.0.0",
60 "karma": "~6.3.2",
61 "karma-chrome-launcher": "~3.1.0",
62 "karma-coverage": "~2.0.3",
63 "karma-coverage-istanbul-reporter": "~3.0.2",
64 "karma-jasmine": "~4.0.0",
65 "karma-jasmine-html-reporter": "^1.5.0",
66 "protractor": "~7.0.0",
67 "ts-node": "~8.3.0",
68 "typescript": "~4.2.4",
69 "@angular-devkit/architect": "^0.1200.0",
70 "firebase-tools": "^9.0.0",
71 "fuzzy": "^0.1.3",
72 "inquirer": "^6.2.2",
73 "inquirer-autocomplete-prompt": "^1.0.1",
74 "open": "^7.0.3",
75 "jsonc-parser": "^3.0.0"
76 },
77 "description": "An Ionic project"
78}
79import { NgModule } from '@angular/core';
80import { BrowserModule } from '@angular/platform-browser';
81import { RouteReuseStrategy } from '@angular/router';
82import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
83import { AppRoutingModule } from './app-routing.module';
84import { AppComponent } from './app.component';
85import { ClientPageModule } from './client/client.module';
86import { environment } from '../environments/environment';
87import { AngularFireModule } from '@angular/fire';
88import { AngularFireAuthModule } from '@angular/fire/auth';
89import { AngularFireStorageModule } from '@angular/fire/storage';
90import { AngularFireDatabaseModule } from '@angular/fire/database';
91
92@NgModule({
93 declarations: [AppComponent],
94 entryComponents: [],
95 imports: [
96 BrowserModule,
97 IonicModule.forRoot(),
98 AppRoutingModule,
99 ClientPageModule,
100 AngularFireModule.initializeApp(environment.firebaseConfig),
101 AngularFireAuthModule,
102 AngularFireStorageModule,
103 AngularFireDatabaseModule
104 ],
105 providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
106 bootstrap: [AppComponent],
107})
108export class AppModule {}
109
Here is my tsonfig.ts file
1'"@angular/fire"' has no exported member 'AngularFireModule'.ts(2305),
2'"@angular/fire/storage"' has no exported member 'AngularFireStorageModule'.ts(2305)
3'"@angular/fire/database"' has no exported member 'AngularFireDatabaseModule'.ts(2305)
4'"@angular/fire/auth"' has no exported member 'AngularFireAuthModule'.ts(2305)
5{
6 "name": "gescable",
7 "version": "0.0.1",
8 "author": "Ionic Framework",
9 "homepage": "https://ionicframework.com/",
10 "scripts": {
11 "ng": "ng",
12 "start": "ng serve",
13 "build": "ng build",
14 "test": "ng test",
15 "lint": "ng lint",
16 "e2e": "ng e2e"
17 },
18 "private": true,
19 "dependencies": {
20 "@angular-devkit/architect": "^0.1202.5",
21 "@angular-devkit/architect-cli": "^0.1202.5",
22 "@angular/common": "~12.1.1",
23 "@angular/core": "~12.1.1",
24 "@angular/fire": "^7.0.4",
25 "@angular/forms": "~12.1.1",
26 "@angular/platform-browser": "~12.1.1",
27 "@angular/platform-browser-dynamic": "~12.1.1",
28 "@angular/router": "~12.1.1",
29 "@ionic/angular": "^5.5.2",
30 "ajv": "^8.6.2",
31 "angularfire2": "^5.4.2",
32 "firebase": "^7.24.0",
33 "rxfire": "^6.0.0",
34 "rxjs": "~6.6.0",
35 "tslib": "^2.2.0",
36 "zone.js": "~0.11.4"
37 },
38 "devDependencies": {
39 "@angular-devkit/build-angular": "~12.1.1",
40 "@angular-eslint/builder": "~12.0.0",
41 "@angular-eslint/eslint-plugin": "~12.0.0",
42 "@angular-eslint/eslint-plugin-template": "~12.0.0",
43 "@angular-eslint/template-parser": "~12.0.0",
44 "@angular/cli": "~12.1.1",
45 "@angular/compiler": "~12.1.1",
46 "@angular/compiler-cli": "~12.1.1",
47 "@angular/language-service": "~12.0.1",
48 "@ionic/angular-toolkit": "^4.0.0",
49 "@types/jasmine": "~3.6.0",
50 "@types/jasminewd2": "~2.0.3",
51 "@types/node": "^12.11.1",
52 "@typescript-eslint/eslint-plugin": "4.16.1",
53 "@typescript-eslint/parser": "4.16.1",
54 "eslint": "^7.6.0",
55 "eslint-plugin-import": "2.22.1",
56 "eslint-plugin-jsdoc": "30.7.6",
57 "eslint-plugin-prefer-arrow": "1.2.2",
58 "jasmine-core": "~3.8.0",
59 "jasmine-spec-reporter": "~5.0.0",
60 "karma": "~6.3.2",
61 "karma-chrome-launcher": "~3.1.0",
62 "karma-coverage": "~2.0.3",
63 "karma-coverage-istanbul-reporter": "~3.0.2",
64 "karma-jasmine": "~4.0.0",
65 "karma-jasmine-html-reporter": "^1.5.0",
66 "protractor": "~7.0.0",
67 "ts-node": "~8.3.0",
68 "typescript": "~4.2.4",
69 "@angular-devkit/architect": "^0.1200.0",
70 "firebase-tools": "^9.0.0",
71 "fuzzy": "^0.1.3",
72 "inquirer": "^6.2.2",
73 "inquirer-autocomplete-prompt": "^1.0.1",
74 "open": "^7.0.3",
75 "jsonc-parser": "^3.0.0"
76 },
77 "description": "An Ionic project"
78}
79import { NgModule } from '@angular/core';
80import { BrowserModule } from '@angular/platform-browser';
81import { RouteReuseStrategy } from '@angular/router';
82import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
83import { AppRoutingModule } from './app-routing.module';
84import { AppComponent } from './app.component';
85import { ClientPageModule } from './client/client.module';
86import { environment } from '../environments/environment';
87import { AngularFireModule } from '@angular/fire';
88import { AngularFireAuthModule } from '@angular/fire/auth';
89import { AngularFireStorageModule } from '@angular/fire/storage';
90import { AngularFireDatabaseModule } from '@angular/fire/database';
91
92@NgModule({
93 declarations: [AppComponent],
94 entryComponents: [],
95 imports: [
96 BrowserModule,
97 IonicModule.forRoot(),
98 AppRoutingModule,
99 ClientPageModule,
100 AngularFireModule.initializeApp(environment.firebaseConfig),
101 AngularFireAuthModule,
102 AngularFireStorageModule,
103 AngularFireDatabaseModule
104 ],
105 providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
106 bootstrap: [AppComponent],
107})
108export class AppModule {}
109 "compileOnSave": false,
110 "compilerOptions": {
111 "baseUrl": "./",
112 "outDir": "./dist/out-tsc",
113 "sourceMap": true,
114 "declaration": false,
115 "downlevelIteration": true,
116 "experimentalDecorators": true,
117 "moduleResolution": "node",
118 "importHelpers": true,
119 "target": "es2015",
120 "module": "es2020",
121 "lib": ["es2018", "dom"]
122 },
123 "angularCompilerOptions": {
124 "enableI18nLegacyMessageIdFormat": false,
125 "strictInjectionParameters": true,
126 "strictInputAccessModifiers": true,
127 "strictTemplates": true,
128 "skipLibCheck": true
129 }
130}
131
ANSWER
Answered 2021-Sep-10 at 12:47You need to add "compat" like this
1'"@angular/fire"' has no exported member 'AngularFireModule'.ts(2305),
2'"@angular/fire/storage"' has no exported member 'AngularFireStorageModule'.ts(2305)
3'"@angular/fire/database"' has no exported member 'AngularFireDatabaseModule'.ts(2305)
4'"@angular/fire/auth"' has no exported member 'AngularFireAuthModule'.ts(2305)
5{
6 "name": "gescable",
7 "version": "0.0.1",
8 "author": "Ionic Framework",
9 "homepage": "https://ionicframework.com/",
10 "scripts": {
11 "ng": "ng",
12 "start": "ng serve",
13 "build": "ng build",
14 "test": "ng test",
15 "lint": "ng lint",
16 "e2e": "ng e2e"
17 },
18 "private": true,
19 "dependencies": {
20 "@angular-devkit/architect": "^0.1202.5",
21 "@angular-devkit/architect-cli": "^0.1202.5",
22 "@angular/common": "~12.1.1",
23 "@angular/core": "~12.1.1",
24 "@angular/fire": "^7.0.4",
25 "@angular/forms": "~12.1.1",
26 "@angular/platform-browser": "~12.1.1",
27 "@angular/platform-browser-dynamic": "~12.1.1",
28 "@angular/router": "~12.1.1",
29 "@ionic/angular": "^5.5.2",
30 "ajv": "^8.6.2",
31 "angularfire2": "^5.4.2",
32 "firebase": "^7.24.0",
33 "rxfire": "^6.0.0",
34 "rxjs": "~6.6.0",
35 "tslib": "^2.2.0",
36 "zone.js": "~0.11.4"
37 },
38 "devDependencies": {
39 "@angular-devkit/build-angular": "~12.1.1",
40 "@angular-eslint/builder": "~12.0.0",
41 "@angular-eslint/eslint-plugin": "~12.0.0",
42 "@angular-eslint/eslint-plugin-template": "~12.0.0",
43 "@angular-eslint/template-parser": "~12.0.0",
44 "@angular/cli": "~12.1.1",
45 "@angular/compiler": "~12.1.1",
46 "@angular/compiler-cli": "~12.1.1",
47 "@angular/language-service": "~12.0.1",
48 "@ionic/angular-toolkit": "^4.0.0",
49 "@types/jasmine": "~3.6.0",
50 "@types/jasminewd2": "~2.0.3",
51 "@types/node": "^12.11.1",
52 "@typescript-eslint/eslint-plugin": "4.16.1",
53 "@typescript-eslint/parser": "4.16.1",
54 "eslint": "^7.6.0",
55 "eslint-plugin-import": "2.22.1",
56 "eslint-plugin-jsdoc": "30.7.6",
57 "eslint-plugin-prefer-arrow": "1.2.2",
58 "jasmine-core": "~3.8.0",
59 "jasmine-spec-reporter": "~5.0.0",
60 "karma": "~6.3.2",
61 "karma-chrome-launcher": "~3.1.0",
62 "karma-coverage": "~2.0.3",
63 "karma-coverage-istanbul-reporter": "~3.0.2",
64 "karma-jasmine": "~4.0.0",
65 "karma-jasmine-html-reporter": "^1.5.0",
66 "protractor": "~7.0.0",
67 "ts-node": "~8.3.0",
68 "typescript": "~4.2.4",
69 "@angular-devkit/architect": "^0.1200.0",
70 "firebase-tools": "^9.0.0",
71 "fuzzy": "^0.1.3",
72 "inquirer": "^6.2.2",
73 "inquirer-autocomplete-prompt": "^1.0.1",
74 "open": "^7.0.3",
75 "jsonc-parser": "^3.0.0"
76 },
77 "description": "An Ionic project"
78}
79import { NgModule } from '@angular/core';
80import { BrowserModule } from '@angular/platform-browser';
81import { RouteReuseStrategy } from '@angular/router';
82import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
83import { AppRoutingModule } from './app-routing.module';
84import { AppComponent } from './app.component';
85import { ClientPageModule } from './client/client.module';
86import { environment } from '../environments/environment';
87import { AngularFireModule } from '@angular/fire';
88import { AngularFireAuthModule } from '@angular/fire/auth';
89import { AngularFireStorageModule } from '@angular/fire/storage';
90import { AngularFireDatabaseModule } from '@angular/fire/database';
91
92@NgModule({
93 declarations: [AppComponent],
94 entryComponents: [],
95 imports: [
96 BrowserModule,
97 IonicModule.forRoot(),
98 AppRoutingModule,
99 ClientPageModule,
100 AngularFireModule.initializeApp(environment.firebaseConfig),
101 AngularFireAuthModule,
102 AngularFireStorageModule,
103 AngularFireDatabaseModule
104 ],
105 providers: [{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy }],
106 bootstrap: [AppComponent],
107})
108export class AppModule {}
109 "compileOnSave": false,
110 "compilerOptions": {
111 "baseUrl": "./",
112 "outDir": "./dist/out-tsc",
113 "sourceMap": true,
114 "declaration": false,
115 "downlevelIteration": true,
116 "experimentalDecorators": true,
117 "moduleResolution": "node",
118 "importHelpers": true,
119 "target": "es2015",
120 "module": "es2020",
121 "lib": ["es2018", "dom"]
122 },
123 "angularCompilerOptions": {
124 "enableI18nLegacyMessageIdFormat": false,
125 "strictInjectionParameters": true,
126 "strictInputAccessModifiers": true,
127 "strictTemplates": true,
128 "skipLibCheck": true
129 }
130}
131import { AngularFireModule } from "@angular/fire/compat";
132import { AngularFireAuthModule } from "@angular/fire/compat/auth";
133import { AngularFireStorageModule } from '@angular/fire/compat/storage';
134import { AngularFirestoreModule } from '@angular/fire/compat/firestore';
135import { AngularFireDatabaseModule } from '@angular/fire/compat/database';
136
QUESTION
pytube: AttributeError: 'NoneType' object has no attribute 'span'
Asked 2022-Feb-09 at 16:58I just downloaded pytube (version 11.0.1) and started with this code snippet from here:
1from pytube import YouTube
2YouTube('https://youtu.be/9bZkp7q19f0').streams.first().download()
3
which gives this error:
1from pytube import YouTube
2YouTube('https://youtu.be/9bZkp7q19f0').streams.first().download()
3AttributeError Traceback (most recent call last)
4<ipython-input-29-0bfa08b87614> in <module>
5----> 1 YouTube('https://youtu.be/9bZkp7q19f0').streams.first().download()
6
7~/anaconda3/lib/python3.8/site-packages/pytube/__main__.py in streams(self)
8 290 """
9 291 self.check_availability()
10--> 292 return StreamQuery(self.fmt_streams)
11 293
12 294 @property
13
14~/anaconda3/lib/python3.8/site-packages/pytube/__main__.py in fmt_streams(self)
15 175 # https://github.com/pytube/pytube/issues/1054
16 176 try:
17--> 177 extract.apply_signature(stream_manifest, self.vid_info, self.js)
18 178 except exceptions.ExtractError:
19 179 # To force an update to the js file, we clear the cache and retry
20
21~/anaconda3/lib/python3.8/site-packages/pytube/extract.py in apply_signature(stream_manifest, vid_info, js)
22 407
23 408 """
24--> 409 cipher = Cipher(js=js)
25 410
26 411 for i, stream in enumerate(stream_manifest):
27
28~/anaconda3/lib/python3.8/site-packages/pytube/cipher.py in __init__(self, js)
29 42
30 43 self.throttling_plan = get_throttling_plan(js)
31---> 44 self.throttling_array = get_throttling_function_array(js)
32 45
33 46 self.calculated_n = None
34
35~/anaconda3/lib/python3.8/site-packages/pytube/cipher.py in get_throttling_function_array(js)
36 321
37 322 array_raw = find_object_from_startpoint(raw_code, match.span()[1] - 1)
38--> 323 str_array = throttling_array_split(array_raw)
39 324
40 325 converted_array = []
41
42~/anaconda3/lib/python3.8/site-packages/pytube/parser.py in throttling_array_split(js_array)
43 156 # Handle functions separately. These can contain commas
44 157 match = func_regex.search(curr_substring)
45--> 158 match_start, match_end = match.span()
46 159
47 160 function_text = find_object_from_startpoint(curr_substring, match.span()[1])
48
49AttributeError: 'NoneType' object has no attribute 'span'
50
and I wonder why? Can anyone help me? I am running this snippet in an ipython console (IPython version 7.22.0) with Python 3.8.8 in a conda environment.
ANSWER
Answered 2021-Nov-22 at 07:03Found this issue, pytube v11.0.1. It's a little late for me, but if no one has submitted a fix tomorrow I'll check it out.
in C:\Python38\lib\site-packages\pytube\parser.py
Change this line:
152: func_regex = re.compile(r"function\([^)]+\)")
to this:
152: func_regex = re.compile(r"function\([^)]?\)")
The issue is that the regex expects a function with an argument, but I guess youtube added some src that includes non-paramterized functions.
QUESTION
Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in the package.json of a module in node_modules
Asked 2022-Jan-31 at 17:22This is a React web app. When I run
1npm start
2
This error occurred
1npm start
2> dataflow@0.1.0 start
3> react-scripts start
4
5node:internal/modules/cjs/loader:488
6 throw e;
7 ^
8
9Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/juliantc/Desktop/ai-studio/development/frontend/node_modules/postcss-safe-parser/node_modules/postcss/package.json
10 at new NodeError (node:internal/errors:371:5)
11 at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
12 at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
13 at resolveExports (node:internal/modules/cjs/loader:482:36)
14 at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
15 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
16 at Function.Module._load (node:internal/modules/cjs/loader:778:27)
17 at Module.require (node:internal/modules/cjs/loader:999:19)
18 at require (node:internal/modules/cjs/helpers:102:18)
19 at Object.<anonymous> (/Users/juliantc/Desktop/ai- studio/development/frontend/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
20 code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
21}
22
23Node.js v17.0.1
24
This error only occurs when I run this on this specific computer, which I do not have superuser access to. It works on other computers.
For reference, this is ./node_modules/postcss-safe-parser/node_modules/postcss/package.json
1npm start
2> dataflow@0.1.0 start
3> react-scripts start
4
5node:internal/modules/cjs/loader:488
6 throw e;
7 ^
8
9Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/juliantc/Desktop/ai-studio/development/frontend/node_modules/postcss-safe-parser/node_modules/postcss/package.json
10 at new NodeError (node:internal/errors:371:5)
11 at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
12 at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
13 at resolveExports (node:internal/modules/cjs/loader:482:36)
14 at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
15 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
16 at Function.Module._load (node:internal/modules/cjs/loader:778:27)
17 at Module.require (node:internal/modules/cjs/loader:999:19)
18 at require (node:internal/modules/cjs/helpers:102:18)
19 at Object.<anonymous> (/Users/juliantc/Desktop/ai- studio/development/frontend/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
20 code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
21}
22
23Node.js v17.0.1
24{
25 "name": "postcss",
26 "version": "8.2.6",
27 "description": "Tool for transforming styles with JS plugins",
28 "engines": {
29 "node": "^10 || ^12 || >=14"
30 },
31 "exports": {
32 ".": {
33 "require": "./lib/postcss.js",
34 "import": "./lib/postcss.mjs",
35 "types": "./lib/postcss.d.ts"
36 },
37 "./": "./"
38 },
39 "main": "./lib/postcss.js",
40 "types": "./lib/postcss.d.ts",
41 "keywords": [
42 "css",
43 "postcss",
44 "rework",
45 "preprocessor",
46 "parser",
47 "source map",
48 "transform",
49 "manipulation",
50 "transpiler"
51 ],
52 "funding": {
53 "type": "opencollective",
54 "url": "https://opencollective.com/postcss/"
55 },
56 "author": "Andrey Sitnik <andrey@sitnik.ru>",
57 "license": "MIT",
58 "homepage": "https://postcss.org/",
59 "repository": "postcss/postcss",
60 "dependencies": {
61 "colorette": "^1.2.1",
62 "nanoid": "^3.1.20",
63 "source-map": "^0.6.1"
64 },
65 "browser": {
66 "./lib/terminal-highlight": false,
67 "colorette": false,
68 "fs": false
69 }
70}
And this is what I get when I list the files in ./node_modules/postcss-safe-parser/node_modules/postcss/lib/
lgtd-lt-119-mbmt:frontend juliantc$ ls ./node_modules/postcss-safe-parser/node_modules/postcss/lib/
1npm start
2> dataflow@0.1.0 start
3> react-scripts start
4
5node:internal/modules/cjs/loader:488
6 throw e;
7 ^
8
9Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/juliantc/Desktop/ai-studio/development/frontend/node_modules/postcss-safe-parser/node_modules/postcss/package.json
10 at new NodeError (node:internal/errors:371:5)
11 at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
12 at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
13 at resolveExports (node:internal/modules/cjs/loader:482:36)
14 at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
15 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
16 at Function.Module._load (node:internal/modules/cjs/loader:778:27)
17 at Module.require (node:internal/modules/cjs/loader:999:19)
18 at require (node:internal/modules/cjs/helpers:102:18)
19 at Object.<anonymous> (/Users/juliantc/Desktop/ai- studio/development/frontend/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
20 code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
21}
22
23Node.js v17.0.1
24{
25 "name": "postcss",
26 "version": "8.2.6",
27 "description": "Tool for transforming styles with JS plugins",
28 "engines": {
29 "node": "^10 || ^12 || >=14"
30 },
31 "exports": {
32 ".": {
33 "require": "./lib/postcss.js",
34 "import": "./lib/postcss.mjs",
35 "types": "./lib/postcss.d.ts"
36 },
37 "./": "./"
38 },
39 "main": "./lib/postcss.js",
40 "types": "./lib/postcss.d.ts",
41 "keywords": [
42 "css",
43 "postcss",
44 "rework",
45 "preprocessor",
46 "parser",
47 "source map",
48 "transform",
49 "manipulation",
50 "transpiler"
51 ],
52 "funding": {
53 "type": "opencollective",
54 "url": "https://opencollective.com/postcss/"
55 },
56 "author": "Andrey Sitnik <andrey@sitnik.ru>",
57 "license": "MIT",
58 "homepage": "https://postcss.org/",
59 "repository": "postcss/postcss",
60 "dependencies": {
61 "colorette": "^1.2.1",
62 "nanoid": "^3.1.20",
63 "source-map": "^0.6.1"
64 },
65 "browser": {
66 "./lib/terminal-highlight": false,
67 "colorette": false,
68 "fs": false
69 }
70}at-rule.d.ts css-syntax-error.d.ts input.d.ts map-generator.js postcss.d.ts processor.js rule.js tokenize.js
71at-rule.js css-syntax-error.js input.js node.d.ts postcss.js result.d.ts stringifier.js warn-once.js
72comment.d.ts declaration.d.ts lazy-result.d.ts node.js postcss.mjs result.js stringify.d.ts warning.d.ts
73comment.js declaration.js lazy-result.js parse.d.ts previous-map.d.ts root.d.ts stringify.js warning.js
74container.d.ts fromJSON.d.ts list.d.ts parse.js previous-map.js root.js symbols.js
75container.js fromJSON.js list.js parser.js processor.d.ts rule.d.ts terminal-highlight.js
76
ANSWER
Answered 2021-Nov-13 at 18:36I am also stuck with the same problem because I installed the latest version of Node.js (v17.0.1).
Just go for node.js v14.18.1
and remove the latest version just use the stable version v14.18.1
1npm start
2> dataflow@0.1.0 start
3> react-scripts start
4
5node:internal/modules/cjs/loader:488
6 throw e;
7 ^
8
9Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/juliantc/Desktop/ai-studio/development/frontend/node_modules/postcss-safe-parser/node_modules/postcss/package.json
10 at new NodeError (node:internal/errors:371:5)
11 at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
12 at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
13 at resolveExports (node:internal/modules/cjs/loader:482:36)
14 at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
15 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
16 at Function.Module._load (node:internal/modules/cjs/loader:778:27)
17 at Module.require (node:internal/modules/cjs/loader:999:19)
18 at require (node:internal/modules/cjs/helpers:102:18)
19 at Object.<anonymous> (/Users/juliantc/Desktop/ai- studio/development/frontend/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
20 code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
21}
22
23Node.js v17.0.1
24{
25 "name": "postcss",
26 "version": "8.2.6",
27 "description": "Tool for transforming styles with JS plugins",
28 "engines": {
29 "node": "^10 || ^12 || >=14"
30 },
31 "exports": {
32 ".": {
33 "require": "./lib/postcss.js",
34 "import": "./lib/postcss.mjs",
35 "types": "./lib/postcss.d.ts"
36 },
37 "./": "./"
38 },
39 "main": "./lib/postcss.js",
40 "types": "./lib/postcss.d.ts",
41 "keywords": [
42 "css",
43 "postcss",
44 "rework",
45 "preprocessor",
46 "parser",
47 "source map",
48 "transform",
49 "manipulation",
50 "transpiler"
51 ],
52 "funding": {
53 "type": "opencollective",
54 "url": "https://opencollective.com/postcss/"
55 },
56 "author": "Andrey Sitnik <andrey@sitnik.ru>",
57 "license": "MIT",
58 "homepage": "https://postcss.org/",
59 "repository": "postcss/postcss",
60 "dependencies": {
61 "colorette": "^1.2.1",
62 "nanoid": "^3.1.20",
63 "source-map": "^0.6.1"
64 },
65 "browser": {
66 "./lib/terminal-highlight": false,
67 "colorette": false,
68 "fs": false
69 }
70}at-rule.d.ts css-syntax-error.d.ts input.d.ts map-generator.js postcss.d.ts processor.js rule.js tokenize.js
71at-rule.js css-syntax-error.js input.js node.d.ts postcss.js result.d.ts stringifier.js warn-once.js
72comment.d.ts declaration.d.ts lazy-result.d.ts node.js postcss.mjs result.js stringify.d.ts warning.d.ts
73comment.js declaration.js lazy-result.js parse.d.ts previous-map.d.ts root.d.ts stringify.js warning.js
74container.d.ts fromJSON.d.ts list.d.ts parse.js previous-map.js root.js symbols.js
75container.js fromJSON.js list.js parser.js processor.d.ts rule.d.ts terminal-highlight.js
76nvm uninstall <version>
77
OR
1npm start
2> dataflow@0.1.0 start
3> react-scripts start
4
5node:internal/modules/cjs/loader:488
6 throw e;
7 ^
8
9Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/juliantc/Desktop/ai-studio/development/frontend/node_modules/postcss-safe-parser/node_modules/postcss/package.json
10 at new NodeError (node:internal/errors:371:5)
11 at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
12 at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
13 at resolveExports (node:internal/modules/cjs/loader:482:36)
14 at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
15 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
16 at Function.Module._load (node:internal/modules/cjs/loader:778:27)
17 at Module.require (node:internal/modules/cjs/loader:999:19)
18 at require (node:internal/modules/cjs/helpers:102:18)
19 at Object.<anonymous> (/Users/juliantc/Desktop/ai- studio/development/frontend/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
20 code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
21}
22
23Node.js v17.0.1
24{
25 "name": "postcss",
26 "version": "8.2.6",
27 "description": "Tool for transforming styles with JS plugins",
28 "engines": {
29 "node": "^10 || ^12 || >=14"
30 },
31 "exports": {
32 ".": {
33 "require": "./lib/postcss.js",
34 "import": "./lib/postcss.mjs",
35 "types": "./lib/postcss.d.ts"
36 },
37 "./": "./"
38 },
39 "main": "./lib/postcss.js",
40 "types": "./lib/postcss.d.ts",
41 "keywords": [
42 "css",
43 "postcss",
44 "rework",
45 "preprocessor",
46 "parser",
47 "source map",
48 "transform",
49 "manipulation",
50 "transpiler"
51 ],
52 "funding": {
53 "type": "opencollective",
54 "url": "https://opencollective.com/postcss/"
55 },
56 "author": "Andrey Sitnik <andrey@sitnik.ru>",
57 "license": "MIT",
58 "homepage": "https://postcss.org/",
59 "repository": "postcss/postcss",
60 "dependencies": {
61 "colorette": "^1.2.1",
62 "nanoid": "^3.1.20",
63 "source-map": "^0.6.1"
64 },
65 "browser": {
66 "./lib/terminal-highlight": false,
67 "colorette": false,
68 "fs": false
69 }
70}at-rule.d.ts css-syntax-error.d.ts input.d.ts map-generator.js postcss.d.ts processor.js rule.js tokenize.js
71at-rule.js css-syntax-error.js input.js node.d.ts postcss.js result.d.ts stringifier.js warn-once.js
72comment.d.ts declaration.d.ts lazy-result.d.ts node.js postcss.mjs result.js stringify.d.ts warning.d.ts
73comment.js declaration.js lazy-result.js parse.d.ts previous-map.d.ts root.d.ts stringify.js warning.js
74container.d.ts fromJSON.d.ts list.d.ts parse.js previous-map.js root.js symbols.js
75container.js fromJSON.js list.js parser.js processor.d.ts rule.d.ts terminal-highlight.js
76nvm uninstall <version>
77nvm uninstall v17.0.1
78
then install the LTS
one which is v14.18.1
1npm start
2> dataflow@0.1.0 start
3> react-scripts start
4
5node:internal/modules/cjs/loader:488
6 throw e;
7 ^
8
9Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './lib/tokenize' is not defined by "exports" in /Users/juliantc/Desktop/ai-studio/development/frontend/node_modules/postcss-safe-parser/node_modules/postcss/package.json
10 at new NodeError (node:internal/errors:371:5)
11 at throwExportsNotFound (node:internal/modules/esm/resolve:416:9)
12 at packageExportsResolve (node:internal/modules/esm/resolve:669:3)
13 at resolveExports (node:internal/modules/cjs/loader:482:36)
14 at Function.Module._findPath (node:internal/modules/cjs/loader:522:31)
15 at Function.Module._resolveFilename (node:internal/modules/cjs/loader:919:27)
16 at Function.Module._load (node:internal/modules/cjs/loader:778:27)
17 at Module.require (node:internal/modules/cjs/loader:999:19)
18 at require (node:internal/modules/cjs/helpers:102:18)
19 at Object.<anonymous> (/Users/juliantc/Desktop/ai- studio/development/frontend/node_modules/postcss-safe-parser/lib/safe-parser.js:1:17) {
20 code: 'ERR_PACKAGE_PATH_NOT_EXPORTED'
21}
22
23Node.js v17.0.1
24{
25 "name": "postcss",
26 "version": "8.2.6",
27 "description": "Tool for transforming styles with JS plugins",
28 "engines": {
29 "node": "^10 || ^12 || >=14"
30 },
31 "exports": {
32 ".": {
33 "require": "./lib/postcss.js",
34 "import": "./lib/postcss.mjs",
35 "types": "./lib/postcss.d.ts"
36 },
37 "./": "./"
38 },
39 "main": "./lib/postcss.js",
40 "types": "./lib/postcss.d.ts",
41 "keywords": [
42 "css",
43 "postcss",
44 "rework",
45 "preprocessor",
46 "parser",
47 "source map",
48 "transform",
49 "manipulation",
50 "transpiler"
51 ],
52 "funding": {
53 "type": "opencollective",
54 "url": "https://opencollective.com/postcss/"
55 },
56 "author": "Andrey Sitnik <andrey@sitnik.ru>",
57 "license": "MIT",
58 "homepage": "https://postcss.org/",
59 "repository": "postcss/postcss",
60 "dependencies": {
61 "colorette": "^1.2.1",
62 "nanoid": "^3.1.20",
63 "source-map": "^0.6.1"
64 },
65 "browser": {
66 "./lib/terminal-highlight": false,
67 "colorette": false,
68 "fs": false
69 }
70}at-rule.d.ts css-syntax-error.d.ts input.d.ts map-generator.js postcss.d.ts processor.js rule.js tokenize.js
71at-rule.js css-syntax-error.js input.js node.d.ts postcss.js result.d.ts stringifier.js warn-once.js
72comment.d.ts declaration.d.ts lazy-result.d.ts node.js postcss.mjs result.js stringify.d.ts warning.d.ts
73comment.js declaration.js lazy-result.js parse.d.ts previous-map.d.ts root.d.ts stringify.js warning.js
74container.d.ts fromJSON.d.ts list.d.ts parse.js previous-map.js root.js symbols.js
75container.js fromJSON.js list.js parser.js processor.d.ts rule.d.ts terminal-highlight.js
76nvm uninstall <version>
77nvm uninstall v17.0.1
78nvm install --lts
79
This worked for me.
QUESTION
How to combine and then branch in MonadPlus/Alternative
Asked 2022-Jan-26 at 07:57I recently wrote
1do
2 e <- (Left <$> m) <|> (Right <$> n)
3 more actions
4 case e of
5 Left x -> ...
6 Right y -> ...
7
This seems awkward. I know that protolude
(and some other packages) define
1do
2 e <- (Left <$> m) <|> (Right <$> n)
3 more actions
4 case e of
5 Left x -> ...
6 Right y -> ...
7-- Called eitherP in parser combinator libraries
8eitherA :: Alternative f => f a -> f b -> f (Either a b)
9
But even with that, it all feels a bit manual. Is there some nice pattern I haven't seen for tightening it up?
ANSWER
Answered 2022-Jan-24 at 21:54You could perhaps do it like this:
1do
2 e <- (Left <$> m) <|> (Right <$> n)
3 more actions
4 case e of
5 Left x -> ...
6 Right y -> ...
7-- Called eitherP in parser combinator libraries
8eitherA :: Alternative f => f a -> f b -> f (Either a b)
9do
10 let acts = do more actions
11 (do x <- m; acts; ...) <|> (do y <- n; acts; ...)
12
I don't know if that looks better to you.
(Of course this doesn't work out nicely if those more actions
bind many variables)
Community Discussions contain sources that include Stack Exchange Network
Tutorials and Learning Resources in Parser
Tutorials and Learning Resources are not available at this moment for Parser