Import content manager components in Strapi custom plugin - strapi

I’m building a Strapi plugin and I'm trying to reuse some of the componentes from content-manager in the admin directory in the plugin files like this:
import NonRepeatableComponent from "#strapi/admin/admin/src/content-manager/components/NonRepeatableComponent";
But I’m getting this error.
ERROR in ./node_modules/#strapi/admin/admin/src/content-manager/components/NonRepeatableComponent/index.js 22:4
Module parse failed: Unexpected token (22:4)
You may need an appropriate loader to handle this file type, currently no loaders are configured to process this file. See https://webpack.js.org/concepts#loaders
Is there any webpack config I have to add to make it work?

Related

How to use vite inside Laravel package

I am building Laravel package locally and my package has views therefore I am using css and scripts. I decided to use vite but I am kind of stack because vite is looking for manifest.json in main Laravel public folder instead of inside the vendor and my package folder.
This is the error I am getting,
Vite manifest not found at: /Users/User/Sites/laravel-project/public/build/manifest.json
The way I am registering style and script in my package is like below
#vite(['resources/css/app.css', 'resources/js/app.js'])
For some reason you need to pass the second parameter (which is the default):
#vite(['resources/css/critical.css'], config('vite.configs.default.build_path'))

Go Dependency Error in SAM application when building with AWS Toolkit

I have a SAM application that has several endpoints (with their own module) and a seperate module in the same project that has helper functions, services etc.
When building the project with sam build, which should build and deploy all endpoints at once, it causes an error in the build process. The dependencies are definitely included in all related go.mod/go.sum files.
Here's the error:
Running GoModulesBuilder:Build
Build Failed
Error: GoModulesBuilder:Build - Builder Failed: ..\..\service\matchService.go:10:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws (imported by testmodule/service); to add:
go get testmodule/service#v1.0.0
..\..\service\matchService.go:11:2: missing go.sum entry for module providing package github.com/aws/aws-sdk-go/aws/session (imported by testmodule/service); to add: go get testmodule/service#v1.0.0
If I execute sam build in the endpoint folder directly it works flawless however!
This is the basic folder structure of the project:
/api/matches/endpoint-a/main.go
/api/matches/endpoint-a/go.mod <- requires matchService of "testmodule" which lies in /, also requires aws-sdk-go indirectly
/api/matches/endpoint-a/go.sum
/services/matchService
/go.mod <- requires github.com/aws/aws-sdk-go/aws
/go.sum
/template.yaml <- includest AWS::Serverless::Function for endpoint-a

python Sphinx not recognizing modules inside project

I am trying to create autodoc for my python project. the problem is that when I am trying to do make html it's not working...
my project tree looks like -
- docs
- EDA_miner
When the EDA miner contains all the code
https://pasteboard.co/If8dT8AS.png - project tree
in the sphinx's conf.py I configured like -
sys.path.insert(0, os.path.abspath('../..'))
but when I am trying to generate using make html I get
WARNING: autodoc: failed to import module 'app' from module 'EDA_miner';
the following exception was raised:
No module named 'server'
WARNING: autodoc: failed to import module 'menus' from module 'EDA_miner';
the following exception was raised:
No module named 'server'
when I am opening ipython and importing server.py it succeed, how am I doing wrong ?
Make to run make html from within your virtual environment (or just be sure to have all your python dependencies installed)

How to add numpy to required dependencies in autodoc

I get an error when trying to generate the documentation in readthedocs.org, autodoc is failing to import a set of functions with the following error message:
WARNING: autodoc: failed to import function 'open_template' from module 'pypyt'; the following exception was raised:
Missing required dependencies ['numpy']
I'm using the requirements file, so the environment is actually installing numpy. I've tried to mock it, autodoct_mock_imports, autodoct_warningiserro, suppress_warnings, but no has worked.
The conf.py file I use is in the repo below
https://github.com/llulai/pypyt/blob/master/docs/conf.py
Anything I haven't tried yet?
thanks
ps: when I run it locally, it works without any problems

Swift app: “Missing required module” when importing framework that imports static library

Here’s my setup:
Static library of Objective C code called Stat.
A Swift framework that uses code from Stat in its own classes (this framework is called Dyn). The static library and this framework are in the same Xcode project.
A Mac app / project that has the above project as a subproject and which links to Dyn.
In my app I have code like:
import Cocoa
import Dyn
...
SomeDynClass().doSomething()
However, when I try to compile I get an error when I import Dyn. The error is
error: missing required module ‘Stat'
It appears my app can find my framework just fine, but it somehow needs to find a module for my static library, too?
Stat has a module file that’s pretty basic:
module Stat {
header "Stat.h"
export *
}
I think I need to point my Mac app’s framework search paths at Stat but I don’t know why and I don’t know how. How do I solve this?
Select your Target, then go into Build Settings and set the Import Paths within the Swift Compiler - Search Paths section:
${SRCROOT}/Stat
Normally the module would be named the same as the library, however, I'm not sure how you've setup the directory with the module.map (it could be named Dyn perhaps, in which case the Import Path would reflect that name.
Build Settings > Swift Compiler > Search Paths:
${SRCROOT}/(directory with module.map) should resolve itself once
you press enter or tab..
I got the same error when in my unit tests project which involves SQLite3 package. After I add the package, unit tests always throw out error saying "missing required module SQLiteObjc"
I had it fixed by toggle "Force Package Info Generation" on and off in my Unit Tests Target's build setting

Resources